about summary refs log tree commit diff
path: root/app/services/activitypub/fetch_featured_collection_service.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-17 00:49:55 +0100
committerGitHub <noreply@github.com>2022-01-17 00:49:55 +0100
commitd5c9feb7b7fc489afbd0a287431fe07b42451ef0 (patch)
tree8482c1ac948d10fd0c0a2a17c34c44f2b9b09ad0 /app/services/activitypub/fetch_featured_collection_service.rb
parent081e4426f8b4f5377afdd6e68e135a3aded93df1 (diff)
Add support for private pinned posts (#16954)
* Add support for private pinned toots

* Allow local user to pin private toots

* Change wording to avoid "direct message"
Diffstat (limited to 'app/services/activitypub/fetch_featured_collection_service.rb')
-rw-r--r--app/services/activitypub/fetch_featured_collection_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/activitypub/fetch_featured_collection_service.rb b/app/services/activitypub/fetch_featured_collection_service.rb
index 72352aca6..9fce478c1 100644
--- a/app/services/activitypub/fetch_featured_collection_service.rb
+++ b/app/services/activitypub/fetch_featured_collection_service.rb
@@ -23,7 +23,7 @@ class ActivityPub::FetchFeaturedCollectionService < BaseService
 
   def process_items(items)
     status_ids = items.map { |item| value_or_id(item) }
-                      .filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri) unless ActivityPub::TagManager.instance.local_uri?(uri) }
+                      .filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri, on_behalf_of: local_follower) unless ActivityPub::TagManager.instance.local_uri?(uri) }
                       .filter_map { |status| status.id if status.account_id == @account.id }
     to_remove = []
     to_add    = status_ids
@@ -46,4 +46,8 @@ class ActivityPub::FetchFeaturedCollectionService < BaseService
   def supported_context?
     super(@json)
   end
+
+  def local_follower
+    @local_follower ||= account.followers.local.without_suspended.first
+  end
 end