1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-15 07:09:03 +09:00

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:
Plastikmensch 2023-05-14 23:56:10 +02:00 committed by Jeremy Kescher
parent 21975a11fd
commit 03845b0be2
No known key found for this signature in database
GPG Key ID: 80A419A7A613DFA4

View File

@ -179,13 +179,14 @@ class ActivityPub::Activity
nil
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.
# Required by EmojiReact and Like for emoji reactions.
def process_emoji_tags(tags)
as_array(tags).each do |tag|
process_single_emoji tag if tag['type'] == 'Emoji'
end
emoji_tag = as_array(tags).find { |tag| tag['type'] == 'Emoji' }
return if emoji_tag.nil?
process_single_emoji emoji_tag
end
def process_single_emoji(tag)