Skip to content

Commit

Permalink
feat: shorter event format
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Aug 6, 2024
1 parent 6441362 commit 1892e11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/converter/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ func (svc service) ConvertEventToActivity(ctx context.Context, evt *pb.CloudEven
obj.URL = vocab.IRI(addrOrigin)

txt += fmt.Sprintf(
"<br/>Original: <a href=\"%s\">%s</a><br/><a href=\"%s\">All Event Attributes</a>",
"<br/><br/>Original: <a href=\"%s\">%s</a><br/><br/><a href=\"%s\">All Event Attributes</a>",
addrOrigin, addrOrigin, a.URL,
)
obj.Content = vocab.DefaultNaturalLanguageValue(txt)
Expand Down
4 changes: 2 additions & 2 deletions service/converter/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func TestService_ConvertEventToActivity(t *testing.T) {
Type: "Link",
},
Content: vocab.DefaultNaturalLanguageValue(
`The 10 Must-Watch Futuristic Anime That Every Fan Should See <br/> Anime is known for its w...<br/>Original: <a href="https://otakukart.com/the-10-must-watch-futuristic-anime-that-every-fan-should-see/">https://otakukart.com/the-10-must-watch-futuristic-anime-that-every-fan-should-see/</a><br/><a href="https://reader/evt/2jrVcFeXfGNcExKHLCcrrXBYyLJ">All Event Attributes</a>`),
`The 10 Must-Watch Futuristic Anime That Every Fan Should See <br/> Anime is known for its w...<br/><br/>Original: <a href="https://otakukart.com/the-10-must-watch-futuristic-anime-that-every-fan-should-see/">https://otakukart.com/the-10-must-watch-futuristic-anime-that-every-fan-should-see/</a><br/><br/><a href="https://reader/evt/2jrVcFeXfGNcExKHLCcrrXBYyLJ">All Event Attributes</a>`),
Published: ts,
Replies: &vocab.Collection{
ID: "https://otakukart.com/the-10-must-watch-futuristic-anime-that-every-fan-should-see/replies",
Expand Down Expand Up @@ -658,7 +658,7 @@ func TestService_ConvertEventToActivity(t *testing.T) {
for k, c := range cases {
t.Run(k, func(t *testing.T) {
a, err := svc.ConvertEventToActivity(context.TODO(), c.src, c.interestId, c.follower, &ts)
assert.Equal(t, c.dst.Object, a.Object)
assert.Equal(t, c.dst, a)
assert.ErrorIs(t, err, c.err)
})
}
Expand Down

0 comments on commit 1892e11

Please sign in to comment.