From 0ac7b225324cdc3d79f53c15e464feee964b373f Mon Sep 17 00:00:00 2001 From: Plastikmensch Date: Wed, 17 May 2023 17:51:56 +0200 Subject: [PATCH] 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 --- app/validators/status_reaction_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/status_reaction_validator.rb b/app/validators/status_reaction_validator.rb index 0338bf531a..046476de9d 100644 --- a/app/validators/status_reaction_validator.rb +++ b/app/validators/status_reaction_validator.rb @@ -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)