1
0

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 1a42ad69f7
commit 0ac7b22532
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)