about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-11-01 14:37:04 -0600
committerFire Demon <firedemon@creature.cafe>2020-11-01 15:50:21 -0600
commit880bf3bd630e9f8a9bce3a15cdb34ca93e3fc65f (patch)
tree6302c62be271834e294d8642a70f0c1cda26f69d /app/lib
parentf29a38e4e5c913a41bd49a24eb4cc5834d900be1 (diff)
Federate public scope as unlisted unless tags are present
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/tag_manager.rb14
1 files changed, 5 insertions, 9 deletions
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