mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] serdes for moved/also_known_as (#2600)
* [feature] serdes for moved/also_known_as * document `alsoKnownAs` and `movedTo` properties * only implicitly populate AKA uris from DB for local accounts * don't let remotes store more than 20 AKA uris to avoid shenanigans
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user