diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/activitypub/process_account_service.rb | 7 | ||||
-rw-r--r-- | app/services/backup_service.rb | 2 | ||||
-rw-r--r-- | app/services/follow_service.rb | 5 | ||||
-rw-r--r-- | app/services/resolve_account_service.rb | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index d5ede0388..cef658e19 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -18,10 +18,9 @@ class ActivityPub::ProcessAccountService < BaseService RedisLock.acquire(lock_options) do |lock| if lock.acquired? - @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 + @account = Account.find_remote(@username, @domain) + @old_public_key = @account&.public_key + @old_protocol = @account&.protocol create_account if @account.nil? update_account diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index 691d024e1..ab6d090a0 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -66,8 +66,6 @@ class BackupService < BaseService def dump_media_attachments!(tar) MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments| media_attachments.each do |m| - next unless m.file&.path - download_to_tar(tar, m.file, m.file.path) end diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index 4d19002c4..dc47804c0 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -18,13 +18,14 @@ class FollowService < BaseService if source_account.following?(target_account) # We're already following this account, but we'll call follow! again to # make sure the reblogs status is set correctly. - return source_account.follow!(target_account, reblogs: reblogs) + source_account.follow!(target_account, reblogs: reblogs) + return elsif source_account.requested?(target_account) # This isn't managed by a method in AccountInteractions, so we modify it # ourselves if necessary. req = source_account.follow_requests.find_by(target_account: target_account) req.update!(show_reblogs: reblogs) - return req + return end ActivityTracker.increment('activity:interactions') diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb index 1ad9ed407..12e6544a0 100644 --- a/app/services/resolve_account_service.rb +++ b/app/services/resolve_account_service.rb @@ -99,7 +99,7 @@ class ResolveAccountService < BaseService if lock.acquired? @account = Account.find_remote(@username, @domain) - next if actor_json.nil? + next if (@account.present? && !@account.activitypub?) || actor_json.nil? @account = ActivityPub::ProcessAccountService.new.call(@username, @domain, actor_json) else |