Refactor local-URI-to-account resolving (#34349)
This commit is contained in:
parent
4bbe33e0bd
commit
dd23ba9c83
5 changed files with 50 additions and 16 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue