]> cat aescling's git repositories - mastodon.git/commitdiff
Fix remote status fetching for “pure” ActivityPub WEB_ACCOUNT users (#5372)
authorThibG <thib@sitedethib.com>
Fri, 13 Oct 2017 10:58:13 +0000 (12:58 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 13 Oct 2017 10:58:13 +0000 (12:58 +0200)
Remote ActivityPub users that have never been known as OStatus users
(whether or not they support it) will not have a “remote_url” attribute
set. In case they reside on an instance with WEB_DOMAIN ≠ LOCAL_DOMAIN,
the current check did rely on “remote_url” to verify the user's domain.

app/services/fetch_remote_status_service.rb

index cacf6ba5132218d8ef230b5b3c1120413be90849..9c009335b6e967a2654199cbc0ea7d21d1e6e70b 100644 (file)
@@ -40,6 +40,6 @@ class FetchRemoteStatusService < BaseService
   end
 
   def confirmed_domain?(domain, account)
-    account.domain.nil? || domain.casecmp(account.domain).zero? || domain.casecmp(Addressable::URI.parse(account.remote_url).normalized_host).zero?
+    account.domain.nil? || domain.casecmp(account.domain).zero? || domain.casecmp(Addressable::URI.parse(account.remote_url || account.uri).normalized_host).zero?
   end
 end