Only allow reacting with remote emojis when status is local

Handling remote reactions with foreign emojis would require an extensive rewrite of vanilla code, so instead prevent reactions with remote emojis when the status is not local.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
Plastikmensch 2023-05-17 14:26:40 +02:00 committed by Jeremy Kescher
parent 51b00dd034
commit f4f1cc9eab
No known key found for this signature in database
GPG Key ID: 80A419A7A613DFA4
1 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,8 @@ class ReactService < BaseService
authorize_with account, status, :react?
name, domain = emoji.split('@')
return unless domain.nil? || status.local?
custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)
return reaction unless reaction.nil?