|
|
@ -27,10 +27,7 @@ class RemoveStatusService < BaseService |
|
|
|
# original object being removed implicitly removes reblogs |
|
|
|
# original object being removed implicitly removes reblogs |
|
|
|
# of it. The Delete activity of the original is forwarded |
|
|
|
# of it. The Delete activity of the original is forwarded |
|
|
|
# separately. |
|
|
|
# separately. |
|
|
|
if @account.local? && !@options[:original_removed] |
|
|
|
remove_from_remote_reach if @account.local? && !@options[:original_removed] |
|
|
|
remove_from_remote_followers |
|
|
|
|
|
|
|
remove_from_remote_reach |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Since reblogs don't mention anyone, don't get reblogged, |
|
|
|
# Since reblogs don't mention anyone, don't get reblogged, |
|
|
|
# favourited and don't contain their own media attachments |
|
|
|
# favourited and don't contain their own media attachments |
|
|
@ -82,13 +79,10 @@ class RemoveStatusService < BaseService |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def remove_from_remote_reach |
|
|
|
def remove_from_remote_reach |
|
|
|
return if @status.reblog? |
|
|
|
# Followers, relays, people who got mentioned in the status, |
|
|
|
|
|
|
|
# or who reblogged it from someone else might not follow |
|
|
|
# People who got mentioned in the status, or who |
|
|
|
# the author and wouldn't normally receive the delete |
|
|
|
# reblogged it from someone else might not follow |
|
|
|
# notification - so here, we explicitly send it to them |
|
|
|
# the author and wouldn't normally receive the |
|
|
|
|
|
|
|
# delete notification - so here, we explicitly |
|
|
|
|
|
|
|
# send it to them |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
status_reach_finder = StatusReachFinder.new(@status) |
|
|
|
status_reach_finder = StatusReachFinder.new(@status) |
|
|
|
|
|
|
|
|
|
|
@ -97,24 +91,6 @@ class RemoveStatusService < BaseService |
|
|
|
end |
|
|
|
end |
|
|
|
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 |
|
|
|
def signed_activity_json |
|
|
|
@signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) |
|
|
|
@signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) |
|
|
|
end |
|
|
|
end |
|
|
|