about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2018-05-15 23:03:34 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-05-15 16:03:34 +0200
commitd47091eb9742a4df7cad15afb9a4b0f35ed8ff55 (patch)
tree773fb90bdbec512aec0faeb8b7a66e2bc29bbfa7 /app
parent1f74c1dbcbb2cbc538e0cacaef8b4a448fa6f765 (diff)
Fix custom emoji handling in UpdateRemoteProfileService (OStatus) (#7501)
This patch fixes NoMethodError and others in RemoteProfileUpdateWorker.
Diffstat (limited to 'app')
-rw-r--r--app/services/update_remote_profile_service.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/services/update_remote_profile_service.rb b/app/services/update_remote_profile_service.rb
index aca1185de..68d36addf 100644
--- a/app/services/update_remote_profile_service.rb
+++ b/app/services/update_remote_profile_service.rb
@@ -41,24 +41,24 @@ class UpdateRemoteProfileService < BaseService
         account.header.destroy
       end
 
-      save_emojis(account) if remote_profile.emojis.present?
+      save_emojis if remote_profile.emojis.present?
     end
   end
 
-  def save_emojis(parent)
-    do_not_download = DomainBlock.find_by(domain: parent.account.domain)&.reject_media?
+  def save_emojis
+    do_not_download = DomainBlock.find_by(domain: account.domain)&.reject_media?
 
     return if do_not_download
 
-    remote_account.emojis.each do |link|
+    remote_profile.emojis.each do |link|
       next unless link['href'] && link['name']
 
       shortcode = link['name'].delete(':')
-      emoji     = CustomEmoji.find_by(shortcode: shortcode, domain: parent.account.domain)
+      emoji     = CustomEmoji.find_by(shortcode: shortcode, domain: account.domain)
 
       next unless emoji.nil?
 
-      emoji = CustomEmoji.new(shortcode: shortcode, domain: parent.account.domain)
+      emoji = CustomEmoji.new(shortcode: shortcode, domain: account.domain)
       emoji.image_remote_url = link['href']
       emoji.save
     end