Changeset 1cc8c85 in Klonkt
- Timestamp:
- 07/16/2026 12:20:51 PM (8 weeks ago)
- Branches:
- main
- Children:
- 87d2787
- Parents:
- 476d6e7
- git-author:
- Robin <roboburr@…> (07/13/2026 05:48:50 AM)
- git-committer:
- Robin <roboburr@…> (07/16/2026 12:20:51 PM)
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r476d6e7 r1cc8c85 210 210 211 211 // A single post as an AS2 Note (the object), and as a Create activity (for outbox/delivery). 212 export function buildNote(base, site, post) { 212 export function buildNote(base, site, post, opts = {}) { 213 // Replies are Notes too. buildNote is the single entry point for ALL Notes; a reply is 214 // (for now) the simple flavor: pre-baked content, no title/cover/image/audio/embed 215 // machinery, addressed to the parent actor + thread. This early branch keeps that output 216 // byte-identical to the old buildReplyNote. When rich replies land (images/audio/embeds), 217 // this branch collapses and replies flow through the full post pipeline below. `post` here 218 // is the ap_outbox reply row (id, in_reply_to, content, post_slug, created_at, to_actor). 219 if (opts.isReply) { 220 const meR = actorId(base, site.slug); 221 return { 222 id: noteId(base, post.id), 223 type: 'Note', 224 attributedTo: meR, 225 inReplyTo: post.in_reply_to || undefined, 226 content: post.content, 227 url: post.post_slug ? `${base}/${encodeURIComponent(post.post_slug)}` : undefined, 228 published: toISO(post.created_at), 229 to: post.to_actor ? [post.to_actor] : [PUBLIC], 230 cc: [PUBLIC, `${meR}/followers`], 231 tag: [ 232 ...mentionTags(post.content), 233 ...hashtagTags(base, post.content), 234 ], 235 }; 236 } 213 237 const id = noteId(base, post.id); 214 238 const aId = actorId(base, site.slug); … … 1572 1596 1573 1597 export function buildReplyNote(base, site, row) { 1574 const me = actorId(base, site.slug); 1575 return { 1576 id: noteId(base, row.id), 1577 type: 'Note', 1578 attributedTo: me, 1579 inReplyTo: row.in_reply_to || undefined, 1580 content: row.content, 1581 url: row.post_slug ? `${base}/${encodeURIComponent(row.post_slug)}` : undefined, 1582 published: toISO(row.created_at), 1583 to: row.to_actor ? [row.to_actor] : [PUBLIC], 1584 cc: [PUBLIC, `${me}/followers`], 1585 tag: [ 1586 ...mentionTags(row.content), 1587 ...hashtagTags(base, row.content), 1588 ], 1589 }; 1598 // Thin delegate: replies are built by buildNote (the single Note entry point) in reply mode. 1599 return buildNote(base, site, row, { isReply: true }); 1590 1600 } 1591 1601
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)