Skip to content
Snippets Groups Projects
Commit 390bfec6 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Avoid sending some ActivityPub payloads if the receiver will get them through distribution (#4739)

parent c2980d5b
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ class ProcessMentionsService < BaseService
NotifyService.new.call(mentioned_account, mention)
elsif mentioned_account.ostatus? && (Rails.configuration.x.use_ostatus_privacy || !status.stream_entry.hidden?)
NotificationWorker.perform_async(stream_entry_to_xml(status.stream_entry), status.account_id, mentioned_account.id)
elsif mentioned_account.activitypub?
elsif mentioned_account.activitypub? && !mentioned_account.following?(status.account)
ActivityPub::DeliveryWorker.perform_async(build_json(mention.status), mention.status.account_id, mentioned_account.inbox_url)
end
end
......
......@@ -36,7 +36,7 @@ class ReblogService < BaseService
NotifyService.new.call(reblogged_status.account, reblog)
elsif reblogged_status.account.ostatus?
NotificationWorker.perform_async(stream_entry_to_xml(reblog.stream_entry), reblog.account_id, reblogged_status.account_id)
elsif reblogged_status.account.activitypub?
elsif reblogged_status.account.activitypub? && !reblogged_status.account.following?(reblog.account)
ActivityPub::DeliveryWorker.perform_async(build_json(reblog), reblog.account_id, reblogged_status.account.inbox_url)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment