From 7f5a4be58010123bad46c0c7644258630724a80e Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 10 Nov 2018 23:59:51 +0100 Subject: [PATCH] Fix emoji update date processing (#9255) --- app/lib/activitypub/activity/create.rb | 2 +- app/services/activitypub/process_account_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 45079e2b3c..9d2ddd3f6e 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -177,7 +177,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity updated = tag['updated'] emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) - return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && emoji.updated_at >= updated) + return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && updated >= emoji.updated_at) emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri) emoji.image_remote_url = image_url diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index c77858f1df..5c865dae2f 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -232,7 +232,7 @@ class ActivityPub::ProcessAccountService < BaseService updated = tag['updated'] emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) - return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && emoji.updated_at >= updated) + return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && updated >= emoji.updated_at) emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri) emoji.image_remote_url = image_url