Changeset 0448e34 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 08/06/2026 02:04:30 AM (5 weeks ago)
- Branches:
- main
- Children:
- a78a0ef
- Parents:
- 7875a80
- git-author:
- Robin <roboburr@…> (08/06/2026 02:04:29 AM)
- git-committer:
- Claude (agent) <aiclaude@…> (08/06/2026 02:04:30 AM)
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r7875a80 r0448e34 638 638 for (const m of listOutbox(slug).slice(0, need)) { 639 639 items.push({ 640 type: 'sent', outboxId: m.id, to_handle: m.to_handle, in_reply_to: m.in_reply_to,641 post_slug: m.post_slug, content: m.content, editable: m.editable,642 language: m.language, created_at: m.created_at,640 type: 'sent', outboxId: m.id, to_handle: m.to_handle, to_actors: m.to_actors, 641 in_reply_to: m.in_reply_to, post_slug: m.post_slug, content: m.content, 642 editable: m.editable, language: m.language, created_at: m.created_at, 643 643 }); 644 644 } … … 701 701 if (!it || !CONV_TYPES.has(it.type)) return null; 702 702 if (it.post_slug) return `post:${it.post_slug}`; 703 const who = it.handle || it.to_handle || ''; 704 const norm = String(who).trim().toLowerCase().replace(/^@/, ''); 703 let who = it.handle || it.to_handle || ''; 704 // Een direct bericht kan zonder to_handle in de tabel staan (de handle van de 705 // ontvanger was niet af te leiden). De eerste uit to_actors is dan alsnog de 706 // tegenpartij, en zonder deze terugval kreeg een gesprek dat JIJ begon geen 707 // draad -- precies het geval waarin het meest onlogisch is dat het los blijft. 708 if (!who && it.to_actors) { 709 try { 710 const first = JSON.parse(it.to_actors)[0]; 711 if (first) who = deriveHandle(first); 712 } catch { /* geen bruikbare lijst → geen sleutel, het blijft een losse regel */ } 713 } 714 const norm = String(who || '').trim().toLowerCase().replace(/^@/, ''); 705 715 return norm ? `actor:${norm}` : null; 706 716 } … … 3010 3020 // gaat staan (zie threadKey). Zonder die kolom viel een uitwisseling uit 3011 3021 // elkaar in "Verzonden" en "Gesprekken". 3012 return db.prepare('SELECT id, content, to_handle, to_actor, post_slug, in_reply_to, language, created_at FROM ap_outbox WHERE site_slug = ? ORDER BY created_at DESC')3022 return db.prepare('SELECT id, content, to_handle, to_actor, to_actors, post_slug, in_reply_to, language, created_at FROM ap_outbox WHERE site_slug = ? ORDER BY created_at DESC') 3013 3023 .all(siteSlug).map((r) => { const c = stripLeadingMentions(r.content); return { ...r, content: c, editable: outboxEditableText(c) }; }); 3014 3024 }
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)