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 ea10f2e1e0
commit 4e15a89b39
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4

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?