]> cat aescling's git repositories - mastodon.git/commitdiff
Avoid sending some ActivityPub payloads if the receiver will get them through distrib...
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 1 Sep 2017 19:26:01 +0000 (21:26 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Sep 2017 19:26:01 +0000 (21:26 +0200)
app/services/process_mentions_service.rb
app/services/reblog_service.rb

index f123bf8697dbe45a3a07529e01a5f95c46667134..dc386c9e72ba98140b066cbb6bd65cdb6d739f6b 100644 (file)
@@ -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
index 5ed16c64b88d9fa97a1fdd44f9ab80269bb7ab8a..3c4e5847f3050a56884da198a1d8dad2813af3f5 100644 (file)
@@ -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