Skip to content

Commit

Permalink
Improve group processing (mastodon#14279)
Browse files Browse the repository at this point in the history
* Fix the local group's followers collection

* Fix to accept followed relayed_through_account

* Add local delivery to the group's followers

* Fix code style

* Revert "Add local delivery to the group's followers"

This reverts commit 3237eff.
  • Loading branch information
noellabo authored and Mage committed Jan 14, 2022
1 parent 519927d commit d992514
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/lib/activitypub/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def fetch?
end

def followed_by_local_accounts?
@account.passive_relationships.exists?
@account.passive_relationships.exists? || @options[:relayed_through_account]&.passive_relationships&.exists?
end

def requested_through_relay?
Expand Down
12 changes: 6 additions & 6 deletions app/lib/activitypub/tag_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ def to(status)
account_ids = status.active_mentions.pluck(:account_id)
to = status.account.followers.where(id: account_ids).each_with_object([]) do |account, result|
result << uri_for(account)
result << account.followers_url if account.group?
result << account_followers_url(account) if account.group?
end
to.concat(FollowRequest.where(target_account_id: status.account_id, account_id: account_ids).each_with_object([]) do |request, result|
result << uri_for(request.account)
result << request.account.followers_url if request.account.group?
result << account_followers_url(request.account) if request.account.group?
end)
else
status.active_mentions.each_with_object([]) do |mention, result|
result << uri_for(mention.account)
result << mention.account.followers_url if mention.account.group?
result << account_followers_url(mention.account) if mention.account.group?
end
end
end
Expand Down Expand Up @@ -110,16 +110,16 @@ def cc(status)
account_ids = status.active_mentions.pluck(:account_id)
cc.concat(status.account.followers.where(id: account_ids).each_with_object([]) do |account, result|
result << uri_for(account)
result << account.followers_url if account.group?
result << account_followers_url(account) if account.group?
end)
cc.concat(FollowRequest.where(target_account_id: status.account_id, account_id: account_ids).each_with_object([]) do |request, result|
result << uri_for(request.account)
result << request.account.followers_url if request.account.group?
result << account_followers_url(request.account) if request.account.group?
end)
else
cc.concat(status.active_mentions.each_with_object([]) do |mention, result|
result << uri_for(mention.account)
result << mention.account.followers_url if mention.account.group?
result << account_followers_url(mention.account) if mention.account.group?
end)
end
end
Expand Down

0 comments on commit d992514

Please sign in to comment.