]> cat aescling's git repositories - mastodon.git/commitdiff
Fix followers synchronization mechanism not being triggered on mentions (#15026)
authorThibG <thib@sitedethib.com>
Fri, 23 Oct 2020 12:22:16 +0000 (14:22 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Oct 2020 12:22:16 +0000 (14:22 +0200)
e.g. if someone on an instance that previously had followers gets mentioned
in a private toot, before this PR, they would not receive a
Collection-Synchronization header and may show the toot to the former followers
in addition to the mentioned person.

app/services/process_mentions_service.rb

index 0a710f8436165c435592d9e4c45c26d9da544000..4c02c7865279769f03c11394f51fcb684cc1fa18 100644 (file)
@@ -60,7 +60,7 @@ class ProcessMentionsService < BaseService
     if mentioned_account.local?
       LocalNotificationWorker.perform_async(mentioned_account.id, mention.id, mention.class.name, :mention)
     elsif mentioned_account.activitypub?
-      ActivityPub::DeliveryWorker.perform_async(activitypub_json, mention.status.account_id, mentioned_account.inbox_url)
+      ActivityPub::DeliveryWorker.perform_async(activitypub_json, mention.status.account_id, mentioned_account.inbox_url, { synchronize_followers: !mention.status.distributable? })
     end
   end