summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltoas.go
diff options
context:
space:
mode:
authorLibravatar nicole mikołajczyk <git@mkljczk.pl>2025-06-15 12:38:01 +0200
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-06-15 12:38:01 +0200
commit7d50aec6dca079ccc9faa485c2ba53584ce8b01f (patch)
tree1f7e397cabc58e64b2496cb44ff4a980df48ff09 /internal/typeutils/internaltoas.go
parent[feature] Handle retractions of domain permission subscription entries (#4261) (diff)
downloadgotosocial-7d50aec6dca079ccc9faa485c2ba53584ce8b01f.tar.xz
[feature] Outgoing federation of avatar/header descriptions (#4270)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl> # Description This implementation is compatible with Iceshrimp.NET, Pleroma and Chuckya, which already support federated avatar/header descriptions. I will add support for incoming descriptions federation in this or another PR (depending on when this one gets merged). ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [ ] I/we have commented the added code, particularly in hard-to-understand areas. - [ ] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4270 Co-authored-by: nicole mikołajczyk <git@mkljczk.pl> Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
Diffstat (limited to 'internal/typeutils/internaltoas.go')
-rw-r--r--internal/typeutils/internaltoas.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/typeutils/internaltoas.go b/internal/typeutils/internaltoas.go
index 4762e3c8b..3feecaa9b 100644
--- a/internal/typeutils/internaltoas.go
+++ b/internal/typeutils/internaltoas.go
@@ -348,6 +348,12 @@ func (c *Converter) AccountToAS(
avatarURLProperty.AppendIRI(avatarURL)
iconImage.SetActivityStreamsUrl(avatarURLProperty)
+ if a.AvatarMediaAttachment.Description != "" {
+ nameProp := streams.NewActivityStreamsNameProperty()
+ nameProp.AppendXMLSchemaString(a.AvatarMediaAttachment.Description)
+ iconImage.SetActivityStreamsName(nameProp)
+ }
+
iconProperty.AppendActivityStreamsImage(iconImage)
accountable.SetActivityStreamsIcon(iconProperty)
}
@@ -382,6 +388,12 @@ func (c *Converter) AccountToAS(
headerURLProperty.AppendIRI(headerURL)
headerImage.SetActivityStreamsUrl(headerURLProperty)
+ if a.HeaderMediaAttachment.Description != "" {
+ nameProp := streams.NewActivityStreamsNameProperty()
+ nameProp.AppendXMLSchemaString(a.HeaderMediaAttachment.Description)
+ headerImage.SetActivityStreamsName(nameProp)
+ }
+
headerProperty.AppendActivityStreamsImage(headerImage)
accountable.SetActivityStreamsImage(headerProperty)
}