Skip to content
Snippets Groups Projects
Unverified Commit cedcece0 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix deleted pinned posts potentially counting towards the pinned posts limit (#19005)

Fixes #18938
parent 02ba9cfa
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,7 @@ class Api::V1::StatusesController < Api::BaseController
authorize @status, :destroy?
@status.discard
StatusPin.find_by(status: @status)&.destroy
@status.account.statuses_count = @status.account.statuses_count - 1
json = render_to_body json: @status, serializer: REST::StatusSerializer, source_requested: true
......
......@@ -21,6 +21,8 @@ class RemoveStatusService < BaseService
with_lock("distribute:#{@status.id}") do
@status.discard
StatusPin.find_by(status: @status)&.destroy
remove_from_self if @account.local?
remove_from_followers
remove_from_lists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment