Don't allow reactions with disabled custom emojis
Also doesn't set custom_emoji to a local variant of name when not given. Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
parent
63facd7c8e
commit
e90ab798a1
@ -26,7 +26,8 @@ class StatusReaction < ApplicationRecord
|
||||
|
||||
private
|
||||
|
||||
# Sets custom_emoji to nil when disabled
|
||||
def set_custom_emoji
|
||||
self.custom_emoji = CustomEmoji.find_by(shortcode: name, domain: account.domain) if name.blank?
|
||||
self.custom_emoji = CustomEmoji.find_by(disabled: false, shortcode: name, domain: custom_emoji.domain) if name.present? && custom_emoji.present?
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user