about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-10-05 00:16:40 +0200
committerGitHub <noreply@github.com>2022-10-05 00:16:40 +0200
commitcedcece0ccba626d97a910f2e3fecf93c2729ca4 (patch)
tree08fd1eb885aa3356f8dec77baa51fabc9c5a6a6d /app/controllers/api
parent02ba9cfa35c7b2285950955619ae3431391e9625 (diff)
Fix deleted pinned posts potentially counting towards the pinned posts limit (#19005)
Fixes #18938
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/statuses_controller.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb
index 9270117da..1cc5aa32e 100644
--- a/app/controllers/api/v1/statuses_controller.rb
+++ b/app/controllers/api/v1/statuses_controller.rb
@@ -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