about summary refs log tree commit diff
path: root/app/services/activitypub/process_account_service.rb
diff options
context:
space:
mode:
authorStarfall <root@starfall.blue>2020-04-11 20:04:46 -0500
committerStarfall <root@starfall.blue>2020-04-11 20:04:46 -0500
commit144ecfcfc7d9974117f1563084409a9558290a60 (patch)
treea26bd8374e4b8264dbae815fbfbd3b91ae51450b /app/services/activitypub/process_account_service.rb
parent12d35783db1bb302d7540d8d3690ab6eed3dac3b (diff)
Revert "Revert "Merge branch 'glitch'""
This reverts commit 12d35783db1bb302d7540d8d3690ab6eed3dac3b.
Diffstat (limited to 'app/services/activitypub/process_account_service.rb')
-rw-r--r--app/services/activitypub/process_account_service.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index cef658e19..d5ede0388 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -18,9 +18,10 @@ class ActivityPub::ProcessAccountService < BaseService
 
     RedisLock.acquire(lock_options) do |lock|
       if lock.acquired?
-        @account        = Account.find_remote(@username, @domain)
-        @old_public_key = @account&.public_key
-        @old_protocol   = @account&.protocol
+        @account          = Account.remote.find_by(uri: @uri) if @options[:only_key]
+        @account        ||= Account.find_remote(@username, @domain)
+        @old_public_key   = @account&.public_key
+        @old_protocol     = @account&.protocol
 
         create_account if @account.nil?
         update_account