Changeset 55eca8b in Klonkt for src/routes/activitypub.js
- Timestamp:
- 07/30/2026 12:49:18 PM (6 weeks ago)
- Branches:
- main
- Children:
- 1a2f206
- Parents:
- 6a99668
- File:
-
- 1 edited
-
src/routes/activitypub.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/activitypub.js
r6a99668 r55eca8b 280 280 }, 281 281 })); 282 // Inbound REPLIES on your own posts: stored as interactions (the web's 283 // comment machinery), never as mentions, so this read missed them and a 284 // friend's reply arrived everywhere except in your app (Robins melding, 285 // 30-7). Same shape as the other legs; media/quotes ride the stored JSON. 286 const replies = AP.getReplyMessages(auth.site.slug, 60).map((m) => ({ 287 id: `${m.object_uri}#create`, 288 type: 'Create', 289 actor: m.actor_uri, 290 published: AP.isoStamp(m.published || m.created_at), 291 object: { 292 id: m.object_uri, 293 type: 'Note', 294 attributedTo: m.actor_uri, 295 content: AP.stripLeadingMentions(m.content), 296 inReplyTo: m.parent_uri || `${base}/ap/notes/${m.post_id}`, 297 published: AP.isoStamp(m.published || m.created_at), 298 to: [me], 299 tag: [{ type: 'Mention', href: me, name: myHandle }, ...(AP.timelineEmojis(m.emoji_json) || [])], 300 attachment: AP.timelineAttachments(m.media_json), 301 'shaer:quote': AP.timelineQuote(m.quote_json), 302 'shaer:author': (m.actor_name || m.actor_handle || m.actor_icon) ? { 303 name: m.actor_name || undefined, handle: m.actor_handle || undefined, 304 icon: m.actor_icon || undefined, url: m.actor_url || undefined, 305 emojis: (() => { try { return m.actor_emoji_json ? JSON.parse(m.actor_emoji_json) : undefined; } catch { return undefined; } })(), 306 } : undefined, 307 'shaer:embed': embedsAllowed ? AP.timelineEmbed(m.embed_json, { playback: playbackAllowed }) : undefined, 308 }, 309 })); 282 310 // Your OWN sent notes (replies and direct messages, ap_outbox): without 283 311 // them a reply existed everywhere except in your own app, Messages showed … … 295 323 })); 296 324 // Newest first over all legs, so the app can keep treating this as one feed. 297 const items = [...posts, ...messages, ... sent].sort((a, b) => String(b.published || '').localeCompare(String(a.published || '')));325 const items = [...posts, ...messages, ...replies, ...sent].sort((a, b) => String(b.published || '').localeCompare(String(a.published || ''))); 298 326 AP.sendAP(res, { 299 327 '@context': AP.AP_CONTEXT,
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)