diff options
author | 2024-02-06 10:45:46 +0100 | |
---|---|---|
committer | 2024-02-06 09:45:46 +0000 | |
commit | aa396c78d30c129bb2145765d3990571dbc025bb (patch) | |
tree | c2046f00c80b029d4f44a1eaf97ca2e960a492cf /testrig/testmodels.go | |
parent | [chore]: Bump github.com/miekg/dns from 1.1.57 to 1.1.58 (#2606) (diff) | |
download | gotosocial-aa396c78d30c129bb2145765d3990571dbc025bb.tar.xz |
[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
Diffstat (limited to 'testrig/testmodels.go')
-rw-r--r-- | testrig/testmodels.go | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/testrig/testmodels.go b/testrig/testmodels.go index 2f7e53666..b350cafe5 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -2799,6 +2799,8 @@ func NewTestFediPeople() map[string]vocab.ActivityStreamsPerson { nil, URLMustParse("https://unknown-instance.com/users/brand_new_person/outbox"), URLMustParse("https://unknown-instance.com/users/brand_new_person/collections/featured"), + nil, + nil, "brand_new_person", "Geoff Brando New Personson", "hey I'm a new person, your instance hasn't seen me yet uwu", @@ -2820,6 +2822,8 @@ func NewTestFediPeople() map[string]vocab.ActivityStreamsPerson { URLMustParse("https://turnip.farm/sharedInbox"), URLMustParse("https://turnip.farm/users/turniplover6969/outbox"), URLMustParse("https://turnip.farm/users/turniplover6969/collections/featured"), + nil, + nil, "turniplover6969", "Turnip Lover 6969", "I just think they're neat", @@ -2841,6 +2845,8 @@ func NewTestFediPeople() map[string]vocab.ActivityStreamsPerson { URLMustParse("http://example.org/sharedInbox"), URLMustParse("http://example.org/users/Some_User/outbox"), URLMustParse("http://example.org/users/Some_User/collections/featured"), + nil, + nil, "Some_User", "just some user, don't mind me", "Peepee poo poo", @@ -3335,6 +3341,8 @@ func newAPPerson( sharedInboxIRI *url.URL, outboxURI *url.URL, featuredURI *url.URL, + movedToURI *url.URL, + alsoKnownAsURIs []*url.URL, username string, displayName string, note string, @@ -3444,9 +3452,15 @@ func newAPPerson( // devices // NOT IMPLEMENTED, probably won't implement - // alsoKnownAs + // alsoKnownAs, movedTo // Required for Move activity. - // TODO: NOT IMPLEMENTED **YET** -- this needs to be added as an activitypub extension to https://github.com/go-fed/activity, see https://github.com/go-fed/activity/tree/master/astool + if len(alsoKnownAsURIs) != 0 { + ap.SetAlsoKnownAs(person, alsoKnownAsURIs) + } + + if movedToURI != nil { + ap.SetMovedTo(person, movedToURI) + } // publicKey // Required for signatures. @@ -3628,7 +3642,7 @@ func newAPGroup( // devices // NOT IMPLEMENTED, probably won't implement - // alsoKnownAs + // AlsoKnownAsURI // Required for Move activity. // TODO: NOT IMPLEMENTED **YET** -- this needs to be added as an activitypub extension to https://github.com/go-fed/activity, see https://github.com/go-fed/activity/tree/master/astool @@ -3812,7 +3826,7 @@ func newAPService( // devices // NOT IMPLEMENTED, probably won't implement - // alsoKnownAs + // AlsoKnownAsURI // Required for Move activity. // TODO: NOT IMPLEMENTED **YET** -- this needs to be added as an activitypub extension to https://github.com/go-fed/activity, see https://github.com/go-fed/activity/tree/master/astool |