about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-04-14 09:17:23 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-04-14 09:17:23 +0000
commite3d0d72b299103d30fcda2b7175906c73c1571bc (patch)
tree055174de4a160b54181bdcaf4c8099ebe44a2a0c /app/services
parentd66192f21c22dd79735a6c3ea6e2ed115b42e0d0 (diff)
parent85ab30abf7f8da61d37e4711cba350877bfb6f2b (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/services')
-rw-r--r--app/services/activitypub/process_account_service.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index 21c2fc57a..4475a9079 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -22,13 +22,15 @@ class ActivityPub::ProcessAccountService < BaseService
 
         create_account if @account.nil?
         update_account
-        process_tags(@account)
+        process_tags
       end
     end
 
+    return if @account.nil?
+
     after_protocol_change! if protocol_changed?
     after_key_change! if key_changed?
-    check_featured_collection! if @account&.featured_collection_url&.present?
+    check_featured_collection! if @account.featured_collection_url.present?
 
     @account
   rescue Oj::ParseError
@@ -189,17 +191,18 @@ class ActivityPub::ProcessAccountService < BaseService
     { redis: Redis.current, key: "process_account:#{@uri}" }
   end
 
-  def process_tags(account)
+  def process_tags
     return if @json['tag'].blank?
+
     as_array(@json['tag']).each do |tag|
       case tag['type']
       when 'Emoji'
-        process_emoji tag, account
+        process_emoji tag
       end
     end
   end
 
-  def process_emoji(tag, _account)
+  def process_emoji(tag)
     return if skip_download?
     return if tag['name'].blank? || tag['icon'].blank? || tag['icon']['url'].blank?