diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 6b8a7153301d88..2726df5c3b2b07 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -262,17 +262,20 @@ def process_emoji(tag) emoji = CustomEmoji.find_by(shortcode: custom_emoji_parser.shortcode, domain: @account.domain) - return unless emoji.nil? || custom_emoji_parser.image_remote_url != emoji.image_remote_url || (custom_emoji_parser.updated_at && custom_emoji_parser.updated_at >= emoji.updated_at) + return unless emoji.nil? || + custom_emoji_parser.image_remote_url != emoji.image_remote_url || + (custom_emoji_parser.updated_at && custom_emoji_parser.updated_at >= emoji.updated_at) || + custom_emoji_parser.license != emoji.license begin emoji ||= CustomEmoji.new( domain: @account.domain, shortcode: custom_emoji_parser.shortcode, - uri: custom_emoji_parser.uri, - is_sensitive: custom_emoji_parser.is_sensitive, - license: custom_emoji_parser.license + uri: custom_emoji_parser.uri ) emoji.image_remote_url = custom_emoji_parser.image_remote_url + emoji.license = custom_emoji_parser.license + emoji.is_sensitive = custom_emoji_parser.is_sensitive emoji.save rescue Seahorse::Client::NetworkingError => e Rails.logger.warn "Error storing emoji: #{e}" diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index 298a81b2928656..9d2abcccf5d46d 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -108,11 +108,11 @@ def process_emoji(tag) emoji ||= CustomEmoji.new( domain: domain, shortcode: custom_emoji_parser.shortcode, - uri: custom_emoji_parser.uri, - is_sensitive: custom_emoji_parser.is_sensitive, - license: custom_emoji_parser.license + uri: custom_emoji_parser.uri ) emoji.image_remote_url = custom_emoji_parser.image_remote_url + emoji.license = custom_emoji_parser.license + emoji.is_sensitive = custom_emoji_parser.is_sensitive emoji.save rescue Seahorse::Client::NetworkingError => e Rails.logger.warn "Error storing emoji: #{e}" diff --git a/app/services/activitypub/process_status_update_service.rb b/app/services/activitypub/process_status_update_service.rb index dd6c8bc8a1f4a9..92d5788151d327 100644 --- a/app/services/activitypub/process_status_update_service.rb +++ b/app/services/activitypub/process_status_update_service.rb @@ -239,11 +239,16 @@ def update_emojis! emoji = CustomEmoji.find_by(shortcode: custom_emoji_parser.shortcode, domain: @account.domain) - next unless emoji.nil? || custom_emoji_parser.image_remote_url != emoji.image_remote_url || (custom_emoji_parser.updated_at && custom_emoji_parser.updated_at >= emoji.updated_at) + next unless emoji.nil? || + custom_emoji_parser.image_remote_url != emoji.image_remote_url || + (custom_emoji_parser.updated_at && custom_emoji_parser.updated_at >= emoji.updated_at) || + custom_emoji_parser.license != emoji.license begin - emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: custom_emoji_parser.shortcode, uri: custom_emoji_parser.uri, is_sensitive: custom_emoji_parser.is_sensitive, license: custom_emoji_parser.license) + emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: custom_emoji_parser.shortcode, uri: custom_emoji_parser.uri) emoji.image_remote_url = custom_emoji_parser.image_remote_url + emoji.license = custom_emoji_parser.license + emoji.is_sensitive = custom_emoji_parser.is_sensitive emoji.save rescue Seahorse::Client::NetworkingError => e Rails.logger.warn "Error storing emoji: #{e}"