summaryrefslogtreecommitdiff
path: root/internal/typeutils/astointernal.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r--internal/typeutils/astointernal.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go
index fa2ae6a62..b262030de 100644
--- a/internal/typeutils/astointernal.go
+++ b/internal/typeutils/astointernal.go
@@ -198,7 +198,25 @@ func (c *Converter) ASRepresentationToAccount(ctx context.Context, accountable a
// TODO: FeaturedTagsURI
- // TODO: alsoKnownAs
+ // Moved and AlsoKnownAsURIs,
+ // needed for account migrations.
+ movedToURI := ap.GetMovedTo(accountable)
+ if movedToURI != nil {
+ acct.MovedToURI = movedToURI.String()
+ }
+
+ alsoKnownAsURIs := ap.GetAlsoKnownAs(accountable)
+ for i, uri := range alsoKnownAsURIs {
+ // Don't store more than
+ // 20 AKA URIs for remotes,
+ // to prevent people playing
+ // silly buggers.
+ if i >= 20 {
+ break
+ }
+
+ acct.AlsoKnownAsURIs = append(acct.AlsoKnownAsURIs, uri.String())
+ }
// Extract account public key and verify ownership to account.
pkey, pkeyURL, pkeyOwnerID, err := ap.ExtractPublicKey(accountable)