about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/statuses_controller.rb1
-rw-r--r--app/services/remove_status_service.rb2
2 files changed, 3 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
 
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index 8dc521eed..f9fdea2cb 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -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