about summary refs log tree commit diff
path: root/app/services/resolve_account_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-22 00:13:10 +0200
committermultiple creatures <dev@multiple-creature.party>2020-02-21 01:48:49 -0600
commit0a238f34b39b606d5f20e1ef1fbdd2a8c56951db (patch)
tree9192e83c420e085c16c8a65fe6077ca30046dd44 /app/services/resolve_account_service.rb
parente6e69f091e3414b29271040926cc1d2e7c5f0e41 (diff)
port tootsuite#11138 to monsterfork: Change domain blocks to automatically support subdomains
* Change domain blocks to automatically support subdomains

If a more authoritative domain is blocked (example.com), then the
same block will be applied to a subdomain (foo.example.com)

* Match subdomains of existing accounts when blocking/unblocking domains

* Improve code style
Diffstat (limited to 'app/services/resolve_account_service.rb')
-rw-r--r--app/services/resolve_account_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb
index c0356a4b3..37c88d113 100644
--- a/app/services/resolve_account_service.rb
+++ b/app/services/resolve_account_service.rb
@@ -102,6 +102,8 @@ class ResolveAccountService < BaseService
     end
 
     @account
+  rescue Oj::ParseError
+    nil
   end
 
   def webfinger_update_due?
@@ -109,7 +111,10 @@ class ResolveAccountService < BaseService
   end
 
   def activitypub_ready?
-    !@webfinger.link('self').nil? && ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(@webfinger.link('self').type)
+    !@webfinger.link('self').nil? &&
+      ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(@webfinger.link('self').type) &&
+      !actor_json.nil? &&
+      actor_json['inbox'].present?
   end
 
   def actor_url