From 880bf3bd630e9f8a9bce3a15cdb34ca93e3fc65f Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 1 Nov 2020 14:37:04 -0600 Subject: Federate public scope as unlisted unless tags are present --- app/lib/activitypub/tag_manager.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index c89c1ebb7..dfb8bce96 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -66,11 +66,9 @@ class ActivityPub::TagManager # Others go out only to the people they mention def to(status, target_domain: nil) case status.visibility_for_domain(target_domain) - when 'public' - [COLLECTIONS[:public]] - when 'unlisted', 'private' - [account_followers_url(status.account)] - when 'direct', 'limited' + when 'public', 'unlisted' + [status.tags.present? ? COLLECTIONS[:public] : account_followers_url(status.account)] + when 'private', 'limited', 'direct' if status.account.silenced? # Only notify followers if the account is locally silenced account_ids = status.active_mentions.pluck(:account_id) @@ -104,10 +102,8 @@ class ActivityPub::TagManager visibility = status.visibility_for_domain(target_domain) case visibility - when 'public' - cc << account_followers_url(status.account) - when 'unlisted' - cc << COLLECTIONS[:public] + when 'public', 'unlisted' + cc << (status.tags.present? ? account_followers_url(status.account) : COLLECTIONS[:public]) when 'limited' if status.account.silenced? # Only notify followers if the account is locally silenced -- cgit