Fix emoji update date processing (#9255)

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
ThibG 2018-11-10 23:59:51 +01:00 committed by Eugen Rochko
parent 9b89c62d43
commit 7f5a4be580
2 changed files with 2 additions and 2 deletions

View File

@ -177,7 +177,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
updated = tag['updated'] updated = tag['updated']
emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) 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 ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri)
emoji.image_remote_url = image_url emoji.image_remote_url = image_url

View File

@ -232,7 +232,7 @@ class ActivityPub::ProcessAccountService < BaseService
updated = tag['updated'] updated = tag['updated']
emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) 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 ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri)
emoji.image_remote_url = image_url emoji.image_remote_url = image_url