Fix mention_urls error

This commit is contained in:
KMY 2023-04-06 10:06:56 +09:00
parent 489eeb4aa7
commit 5b4661c2f7
3 changed files with 22 additions and 2 deletions

View file

@ -212,4 +212,24 @@ class ActivityPub::TagManager
[]
end
end
def mentions_uris(status)
if status.account.silenced?
# Only notify followers if the account is locally silenced
account_ids = status.active_mentions.pluck(:account_id)
uris = status.account.followers.where(id: account_ids).each_with_object([]) do |account, result|
result << uri_for(account)
result << account_followers_url(account) if account.group?
end
uris.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 << 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 << account_followers_url(mention.account) if mention.account.group?
end
end
end
end