]> cat aescling's git repositories - mastodon.git/commitdiff
Fix how other services used old FollowRemoteAccountService
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 17 Sep 2016 15:07:45 +0000 (17:07 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 17 Sep 2016 15:07:45 +0000 (17:07 +0200)
app/services/process_feed_service.rb
app/services/process_interaction_service.rb
app/services/process_mentions_service.rb

index ba7558e1f276b340b01315cac211960b873843eb..e0b8574823dcb8b48a5c5d948608be0992ef6133 100644 (file)
@@ -127,10 +127,11 @@ class ProcessFeedService < BaseService
 
     if account.nil?
       account = follow_remote_account_service.("#{username}@#{domain}", false)
-      return nil if account.nil?
     end
 
     Status.new(account: account, uri: target_id(xml), text: target_content(xml), url: target_url(xml))
+  rescue Goldfinger::Error, HTTP::Error
+    nil
   end
 
   def published(xml)
index d9fcf9032df6a9359277580e9216473b5f98a093..3266f73e3bb02459fba5c0e3b1eb9b57ae4483bc 100644 (file)
@@ -15,7 +15,6 @@ class ProcessInteractionService < BaseService
 
     if account.nil?
       account = follow_remote_account_service.("#{username}@#{domain}", false)
-      return if account.nil?
     end
 
     if salmon.verify(envelope, account.keypair)
@@ -36,6 +35,8 @@ class ProcessInteractionService < BaseService
         delete_post!(xml, account)
       end
     end
+  rescue Goldfinger::Error, HTTP::Error
+    nil
   end
 
   private
index fb605326d5a29bf7d50836de4189ac88b55a5f2d..04171cecb18856821f046a0334c8867623e517ae 100644 (file)
@@ -11,7 +11,10 @@ class ProcessMentionsService < BaseService
       mentioned_account = Account.find_remote(username, domain)
 
       if mentioned_account.nil? && !domain.nil?
-        mentioned_account = follow_remote_account_service.("#{match.first}")
+        begin
+          mentioned_account = follow_remote_account_service.("#{match.first}")
+        rescue Goldfinger::Error, HTTP::Error
+        end
       end
 
       next if mentioned_account.nil?