about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorluigi <007.lva@gmail.com>2021-01-22 10:28:15 -0500
committerGitHub <noreply@github.com>2021-01-22 16:28:15 +0100
commit7ea9588520c664f17a02265d8456b2288476cb9b (patch)
treeb8f3e17383204498ef398347f47b386d56eaa766 /app/services
parentbc4efd5e98078946c1d62ad287361246ca571970 (diff)
Use Enumerable#filter_map in more places (#15527)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/activitypub/fetch_featured_collection_service.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/services/activitypub/fetch_featured_collection_service.rb b/app/services/activitypub/fetch_featured_collection_service.rb
index 82c861f5b..72352aca6 100644
--- a/app/services/activitypub/fetch_featured_collection_service.rb
+++ b/app/services/activitypub/fetch_featured_collection_service.rb
@@ -23,11 +23,8 @@ class ActivityPub::FetchFeaturedCollectionService < BaseService
 
   def process_items(items)
     status_ids = items.map { |item| value_or_id(item) }
-                      .reject { |uri| ActivityPub::TagManager.instance.local_uri?(uri) }
-                      .filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri) }
-                      .select { |status| status.account_id == @account.id }
-                      .map(&:id)
-
+                      .filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri) unless ActivityPub::TagManager.instance.local_uri?(uri) }
+                      .filter_map { |status| status.id if status.account_id == @account.id }
     to_remove = []
     to_add    = status_ids