summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/transport/dereference_test.go6
-rw-r--r--internal/typeutils/internaltoas.go12
-rw-r--r--internal/typeutils/internaltoas_test.go10
-rw-r--r--internal/typeutils/wrap_test.go2
4 files changed, 28 insertions, 2 deletions
diff --git a/internal/transport/dereference_test.go b/internal/transport/dereference_test.go
index 7d9570923..b9611d1e7 100644
--- a/internal/transport/dereference_test.go
+++ b/internal/transport/dereference_test.go
@@ -43,8 +43,8 @@ func (suite *DereferenceTestSuite) TestDerefLocalUser() {
defer resp.Body.Close()
suite.Equal(http.StatusOK, resp.StatusCode)
- suite.EqualValues(1887, resp.ContentLength)
- suite.Equal("1887", resp.Header.Get("Content-Length"))
+ suite.EqualValues(2007, resp.ContentLength)
+ suite.Equal("2007", resp.Header.Get("Content-Length"))
suite.Equal(apiutil.AppActivityLDJSON, resp.Header.Get("Content-Type"))
b, err := io.ReadAll(resp.Body)
@@ -77,12 +77,14 @@ func (suite *DereferenceTestSuite) TestDerefLocalUser() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
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)
}
diff --git a/internal/typeutils/internaltoas_test.go b/internal/typeutils/internaltoas_test.go
index ab81095fd..292d7705a 100644
--- a/internal/typeutils/internaltoas_test.go
+++ b/internal/typeutils/internaltoas_test.go
@@ -66,12 +66,14 @@ func (suite *InternalToASTestSuite) TestAccountToAS() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
@@ -132,12 +134,14 @@ func (suite *InternalToASTestSuite) TestAccountToASBot() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
@@ -278,12 +282,14 @@ func (suite *InternalToASTestSuite) TestAccountToASAliasedAndMoved() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
@@ -403,12 +409,14 @@ func (suite *InternalToASTestSuite) TestAccountToASWithEmoji() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
@@ -478,12 +486,14 @@ func (suite *InternalToASTestSuite) TestAccountToASWithSharedInbox() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},
diff --git a/internal/typeutils/wrap_test.go b/internal/typeutils/wrap_test.go
index 48a28e3b0..828e6a683 100644
--- a/internal/typeutils/wrap_test.go
+++ b/internal/typeutils/wrap_test.go
@@ -200,12 +200,14 @@ func (suite *WrapTestSuite) TestWrapAccountableInUpdate() {
"following": "http://localhost:8080/users/the_mighty_zork/following",
"icon": {
"mediaType": "image/jpeg",
+ "name": "a green goblin looking nasty",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg"
},
"id": "http://localhost:8080/users/the_mighty_zork",
"image": {
"mediaType": "image/jpeg",
+ "name": "A very old-school screenshot of the original team fortress mod for quake",
"type": "Image",
"url": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg"
},