Skip to content

Commit

Permalink
Fix account URI when updating ActivityPub account (#7488)
Browse files Browse the repository at this point in the history
Updates account `uri` field on each call to `update_account` instead of
only once during `create_account` to mirror the same behavior in OStatus
`ResolveAccountService` class [0].

ActivityPub accounts are identified using `@username` and `@domain` pair
instead of URI since #6842.

This fixes #7479: a bug when the account identified by `@username` and
`@domain` changes its URI.

[0]:
https://github.com/tootsuite/mastodon/blob/03b69ebc450efc07246bd64204276941b7ede3fc/app/services/resolve_account_service.rb#L121
  • Loading branch information
wiktor-k authored and Gargron committed May 14, 2018
1 parent 03b69eb commit 7fe2993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/activitypub/process_account_service.rb
Expand Up @@ -44,7 +44,6 @@ def create_account
@account.protocol = :activitypub
@account.username = @username
@account.domain = @domain
@account.uri = @uri
@account.suspended = true if auto_suspend?
@account.silenced = true if auto_silence?
@account.private_key = nil
Expand All @@ -67,6 +66,7 @@ def set_immediate_attributes!
@account.followers_url = @json['followers'] || ''
@account.featured_collection_url = @json['featured'] || ''
@account.url = url || @uri
@account.uri = @uri
@account.display_name = @json['name'] || ''
@account.note = @json['summary'] || ''
@account.locked = @json['manuallyApprovesFollowers'] || false
Expand Down

0 comments on commit 7fe2993

Please sign in to comment.