mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 18:40:12 -05:00
Fix deleted pinned posts potentially counting towards the pinned posts limit (#19005)
Fixes #18938
This commit is contained in:
parent
02ba9cfa35
commit
cedcece0cc
@ -77,6 +77,7 @@ class Api::V1::StatusesController < Api::BaseController
|
|||||||
authorize @status, :destroy?
|
authorize @status, :destroy?
|
||||||
|
|
||||||
@status.discard
|
@status.discard
|
||||||
|
StatusPin.find_by(status: @status)&.destroy
|
||||||
@status.account.statuses_count = @status.account.statuses_count - 1
|
@status.account.statuses_count = @status.account.statuses_count - 1
|
||||||
json = render_to_body json: @status, serializer: REST::StatusSerializer, source_requested: true
|
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
|
with_lock("distribute:#{@status.id}") do
|
||||||
@status.discard
|
@status.discard
|
||||||
|
|
||||||
|
StatusPin.find_by(status: @status)&.destroy
|
||||||
|
|
||||||
remove_from_self if @account.local?
|
remove_from_self if @account.local?
|
||||||
remove_from_followers
|
remove_from_followers
|
||||||
remove_from_lists
|
remove_from_lists
|
||||||
|
Loading…
Reference in New Issue
Block a user