Only process single custom emoji
Processing all custom emojis is neither wise nor necessary as both `Like` and `EmojiReact` only expect a single custom emoji Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
parent
21975a11fd
commit
03845b0be2
|
@ -179,13 +179,14 @@ class ActivityPub::Activity
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ensure all emojis declared in the activity's tags are
|
# Ensure emoji declared in the activity's tags are
|
||||||
# present in the database and downloaded to the local cache.
|
# present in the database and downloaded to the local cache.
|
||||||
# Required by EmojiReact and Like for emoji reactions.
|
# Required by EmojiReact and Like for emoji reactions.
|
||||||
def process_emoji_tags(tags)
|
def process_emoji_tags(tags)
|
||||||
as_array(tags).each do |tag|
|
emoji_tag = as_array(tags).find { |tag| tag['type'] == 'Emoji' }
|
||||||
process_single_emoji tag if tag['type'] == 'Emoji'
|
return if emoji_tag.nil?
|
||||||
end
|
|
||||||
|
process_single_emoji emoji_tag
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_single_emoji(tag)
|
def process_single_emoji(tag)
|
||||||
|
|
Reference in New Issue