summaryrefslogtreecommitdiff
path: root/internal/ap/serialize.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-02-06 10:45:46 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-06 09:45:46 +0000
commitaa396c78d30c129bb2145765d3990571dbc025bb (patch)
treec2046f00c80b029d4f44a1eaf97ca2e960a492cf /internal/ap/serialize.go
parent[chore]: Bump github.com/miekg/dns from 1.1.57 to 1.1.58 (#2606) (diff)
downloadgotosocial-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 'internal/ap/serialize.go')
-rw-r--r--internal/ap/serialize.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/ap/serialize.go b/internal/ap/serialize.go
index 774e95f2d..b13ebb340 100644
--- a/internal/ap/serialize.go
+++ b/internal/ap/serialize.go
@@ -90,13 +90,12 @@ func serializeWithOrderedItems(t vocab.Type) (map[string]interface{}, error) {
}
// SerializeAccountable is a custom serializer for any Accountable type.
-// This serializer rewrites the 'attachment' value of the Accountable, if
-// present, to always be an array/slice.
+// This serializer rewrites certain values of the Accountable, if present,
+// to always be an array/slice.
//
-// While this is not strictly necessary in json-ld terms, most other fedi
-// implementations look for attachment to be an array of PropertyValue (field)
-// entries, and will not parse single-entry, non-array attachments on accounts
-// properly.
+// While this may not always be strictly necessary in json-ld terms, most other
+// fedi implementations look for certain fields to be an array and will not parse
+// single-entry, non-array fields on accounts properly.
//
// If the accountable is being serialized as a top-level object (eg., for serving
// in response to an account dereference request), then includeContext should be
@@ -126,6 +125,7 @@ func serializeAccountable(t vocab.Type, includeContext bool) (map[string]interfa
}
NormalizeOutgoingAttachmentProp(accountable, data)
+ NormalizeOutgoingAlsoKnownAsProp(accountable, data)
return data, nil
}