1
0
Fork 0
forked from gitea/nas

Refactor local-URI-to-account resolving (#34349)

This commit is contained in:
Claire 2025-04-02 16:44:09 +02:00 committed by GitHub
parent 4bbe33e0bd
commit dd23ba9c83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 16 deletions

View file

@ -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?