Fix being able to bypass MAX_REACTIONS

When reacting with different custom emojis with the same shortcode, it would count as an already present reaction and processed, bypassing the limit.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
Plastikmensch 2023-05-17 17:51:56 +02:00 committed by Jeremy Kescher
parent 3a91f535fa
commit 2a13d27be4
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4

View file

@ -19,7 +19,7 @@ class StatusReactionValidator < ActiveModel::Validator
end
def new_reaction?(reaction)
!reaction.status.status_reactions.exists?(status: reaction.status, account: reaction.account, name: reaction.name)
!reaction.status.status_reactions.exists?(status: reaction.status, account: reaction.account, name: reaction.name, custom_emoji: reaction.custom_emoji)
end
def limit_reached?(reaction)