summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltoas.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-05-09 12:16:10 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-09 11:16:10 +0100
commit0e29f1f5bb68a48d9b837d7f4e0a16370734955b (patch)
treef08d203ec8ca8aeea728e5251b1dc3956524b4f4 /internal/typeutils/internaltoas.go
parent[chore/performance] Make sender multiplier configurable (#1750) (diff)
downloadgotosocial-0e29f1f5bb68a48d9b837d7f4e0a16370734955b.tar.xz
[feature] Enable federation in/out of profile PropertyValue fields (#1722)
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
Diffstat (limited to 'internal/typeutils/internaltoas.go')
-rw-r--r--internal/typeutils/internaltoas.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/typeutils/internaltoas.go b/internal/typeutils/internaltoas.go
index ceff1cb4d..3c1615cfb 100644
--- a/internal/typeutils/internaltoas.go
+++ b/internal/typeutils/internaltoas.go
@@ -240,7 +240,25 @@ func (c *converter) AccountToAS(ctx context.Context, a *gtsmodel.Account) (vocab
// attachment
// Used for profile fields.
- // TODO: The PropertyValue type has to be added: https://schema.org/PropertyValue
+ if len(a.Fields) != 0 {
+ attachmentProp := streams.NewActivityStreamsAttachmentProperty()
+
+ for _, field := range a.Fields {
+ propertyValue := streams.NewSchemaPropertyValue()
+
+ nameProp := streams.NewActivityStreamsNameProperty()
+ nameProp.AppendXMLSchemaString(field.Name)
+ propertyValue.SetActivityStreamsName(nameProp)
+
+ valueProp := streams.NewSchemaValueProperty()
+ valueProp.Set(field.Value)
+ propertyValue.SetSchemaValue(valueProp)
+
+ attachmentProp.AppendSchemaPropertyValue(propertyValue)
+ }
+
+ person.SetActivityStreamsAttachment(attachmentProp)
+ }
// endpoints
// NOT IMPLEMENTED -- this is for shared inbox which we don't use