1
0

Per PR suggestion, split name and domain, and look for emoji ID, for unreact, so remote emoji's can be unreacted

This commit is contained in:
neatchee 2023-01-26 10:22:15 -08:00 committed by Jeremy Kescher
parent c1f7ff6129
commit 253c489177
No known key found for this signature in database
GPG Key ID: 80A419A7A613DFA4

View File

@ -3,8 +3,10 @@
class UnreactService < BaseService
include Payloadable
def call(account, status, name)
reaction = StatusReaction.find_by(account: account, status: status, name: name)
def call(account, status, emoji)
name, domain = emoji.split('@')
custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)
return if reaction.nil?
reaction.destroy!