diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-04-20 18:06:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 18:06:40 +0200 |
commit | 97da7b73071e9f515c4bb0bca72c88d1a13b14aa (patch) | |
tree | 89c81064b9e3725962a847e98099a5b84b728733 /app/services/remove_status_service.rb | |
parent | df326b8b5c0659edb2aca77690a892f228b0e099 (diff) | |
parent | 4b115d070c9a8b6082ed207bd0a14e809eded322 (diff) |
Merge pull request #1521 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/remove_status_service.rb')
-rw-r--r-- | app/services/remove_status_service.rb | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb index 764ed288d..17868d4fd 100644 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@ -27,10 +27,7 @@ class RemoveStatusService < BaseService # original object being removed implicitly removes reblogs # of it. The Delete activity of the original is forwarded # separately. - if @account.local? && !@options[:original_removed] - remove_from_remote_followers - remove_from_remote_reach - end + remove_from_remote_reach if @account.local? && !@options[:original_removed] # Since reblogs don't mention anyone, don't get reblogged, # favourited and don't contain their own media attachments @@ -42,7 +39,6 @@ class RemoveStatusService < BaseService remove_from_public remove_from_media if @status.media_attachments.any? remove_from_direct if status.direct_visibility? - remove_from_spam_check remove_media end @@ -85,13 +81,10 @@ class RemoveStatusService < BaseService end def remove_from_remote_reach - return if @status.reblog? - - # People who got mentioned in the status, or who - # reblogged it from someone else might not follow - # the author and wouldn't normally receive the - # delete notification - so here, we explicitly - # send it to them + # Followers, relays, people who got mentioned in the status, + # or who reblogged it from someone else might not follow + # the author and wouldn't normally receive the delete + # notification - so here, we explicitly send it to them status_reach_finder = StatusReachFinder.new(@status) @@ -100,24 +93,6 @@ class RemoveStatusService < BaseService end end - def remove_from_remote_followers - ActivityPub::DeliveryWorker.push_bulk(@account.followers.inboxes) do |inbox_url| - [signed_activity_json, @account.id, inbox_url] - end - - relay! if relayable? - end - - def relayable? - @status.public_visibility? - end - - def relay! - ActivityPub::DeliveryWorker.push_bulk(Relay.enabled.pluck(:inbox_url)) do |inbox_url| - [signed_activity_json, @account.id, inbox_url] - end - end - def signed_activity_json @signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) end @@ -171,10 +146,6 @@ class RemoveStatusService < BaseService @status.media_attachments.destroy_all end - def remove_from_spam_check - redis.zremrangebyscore("spam_check:#{@status.account_id}", @status.id, @status.id) - end - def lock_options { redis: Redis.current, key: "distribute:#{@status.id}" } end |