Refactor local-URI-to-account resolving (#34349)
This commit is contained in:
@@ -412,11 +412,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
def addresses_local_accounts?
|
||||
return true if @options[:delivered_to_account_id]
|
||||
|
||||
local_usernames = (audience_to + audience_cc).uniq.select { |uri| ActivityPub::TagManager.instance.local_uri?(uri) }.map { |uri| ActivityPub::TagManager.instance.uri_to_local_id(uri, :username) }
|
||||
|
||||
return false if local_usernames.empty?
|
||||
|
||||
Account.local.exists?(username: local_usernames)
|
||||
ActivityPub::TagManager.instance.uris_to_local_accounts((audience_to + audience_cc).uniq).exists?
|
||||
end
|
||||
|
||||
def tombstone_exists?
|
||||
|
||||
Reference in New Issue
Block a user