about summary refs log tree commit diff
path: root/app/controllers/activitypub
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-05-31 16:11:02 +0200
committerThibG <thib@sitedethib.com>2020-05-31 17:20:15 +0200
commit18f2c390748a112ac72bf9203f1513d295b13b3d (patch)
treebbbcb24bb54e24bd48667fc5a7eb55b653195731 /app/controllers/activitypub
parentddcd9fe9f0e85b1db12ae584749e680146611f9a (diff)
Hide local-only pinned toots from public profiles
Fixes #1336

This also fixes federating pinned toots when some of them are local-only.

Public profiles will not show public toots, whether you are logged in
or not (this is consistent with local-only toots that are not pinned).
Diffstat (limited to 'app/controllers/activitypub')
-rw-r--r--app/controllers/activitypub/collections_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/activitypub/collections_controller.rb b/app/controllers/activitypub/collections_controller.rb
index c1e7aa550..9ca216e4f 100644
--- a/app/controllers/activitypub/collections_controller.rb
+++ b/app/controllers/activitypub/collections_controller.rb
@@ -24,7 +24,7 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController
   def set_size
     case params[:id]
     when 'featured'
-      @size = @account.pinned_statuses.count
+      @size = @account.pinned_statuses.not_local_only.count
     else
       not_found
     end
@@ -39,7 +39,7 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController
       if authorized_fetch_mode? && !signed_request_account.nil? && (@account.blocking?(signed_request_account) || (!signed_request_account.domain.nil? && @account.domain_blocking?(signed_request_account.domain)))
         Status.none
       else
-        @account.pinned_statuses
+        @account.pinned_statuses.not_local_only
       end
     end
   end