mirror of
https://github.com/mastodon/mastodon.git
synced 2025-03-13 14:08:34 +01:00
Spare processing incoming messages that would only be processed because they are mentioning blocked users
This commit is contained in:
parent
d8857c3c93
commit
fe6511ee45
1 changed files with 3 additions and 1 deletions
|
@ -397,7 +397,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
|
||||
return false if local_usernames.empty?
|
||||
|
||||
Account.local.exists?(username: local_usernames)
|
||||
scope = Account.local.where(Account.arel_table[:username].lower.in(local_usernames.map(&:downcase)))
|
||||
scope = scope.where.not('EXISTS (SELECT 1 FROM blocks WHERE account_id = accounts.id AND target_account_id = ?)', @account.id)
|
||||
scope.exists?
|
||||
end
|
||||
|
||||
def tombstone_exists?
|
||||
|
|
Loading…
Add table
Reference in a new issue