@@ -95,10 +95,15 @@ func apCreateBookmarkItem(c *gin.Context, b *model.Bookmark, actor string) *ap.O
9595 body = fmt .Sprintf ("<p>%s</p>" , truncate (b .Notes , 350 - len (title )))
9696 }
9797 item := & ap.OutboxItem {
98- Context : "https://www.w3.org/ns/activitystreams" ,
99- ID : id + "#activity" ,
100- Type : createAction ,
101- Actor : actor ,
98+ Context : []any {
99+ "https://www.w3.org/ns/activitystreams" ,
100+ map [string ]string {
101+ "Hashtag" : "https://www.w3.org/ns/activitystreams#Hashtag" ,
102+ },
103+ },
104+ ID : id + "#activity" ,
105+ Type : createAction ,
106+ Actor : actor ,
102107 To : []string {
103108 "https://www.w3.org/ns/activitystreams#Public" ,
104109 },
@@ -107,10 +112,10 @@ func apCreateBookmarkItem(c *gin.Context, b *model.Bookmark, actor string) *ap.O
107112 Object : ap.OutboxObject {
108113 ID : id ,
109114 Type : noteAction ,
110- Summary : "" ,
111115 Content : fmt .Sprintf (contentTpl , b .URL , title , body , id ),
112- URL : b . URL ,
116+ URL : id ,
113117 URI : b .URL ,
118+ Summary : "" ,
114119 AttributedTo : actor ,
115120 To : []string {
116121 "https://www.w3.org/ns/activitystreams#Public" ,
@@ -119,14 +124,25 @@ func apCreateBookmarkItem(c *gin.Context, b *model.Bookmark, actor string) *ap.O
119124 Published : published ,
120125 Tag : make ([]ap.Tag , len (b .Tags )),
121126 Replies : map [string ]string {},
127+ Name : b .Title ,
128+ Source : ap.SourceObject {
129+ Content : b .Notes ,
130+ MediaType : "text/plain" ,
131+ },
132+ Attachments : []ap.Attachment {
133+ {
134+ Type : "Link" ,
135+ Href : b .URL ,
136+ },
137+ },
122138 },
123139 }
124140 for i , t := range b .Tags {
125141 tagBase := getFullURL (c , fmt .Sprintf ("%s?tag=" , URLFor ("Public bookmarks" )))
126142 item .Object .Tag [i ] = ap.Tag {
127143 Type : "Hashtag" ,
128144 Href : tagBase + t .Text ,
129- Name : t .Text ,
145+ Name : "#" + t .Text ,
130146 }
131147 }
132148 return item
0 commit comments