Changeset 189e335 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 08/06/2026 07:02:57 AM (5 weeks ago)
- Branches:
- main
- Children:
- 84ce988
- Parents:
- 99a7b40
- git-author:
- Robin <roboburr@…> (08/06/2026 07:02:56 AM)
- git-committer:
- Claude (agent) <aiclaude@…> (08/06/2026 07:02:57 AM)
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r99a7b40 r189e335 653 653 for (const m of listOutbox(slug).slice(0, need)) { 654 654 items.push({ 655 type: 'sent', outboxId: m.id, to_handle: m.to_handle, to_actor s: m.to_actors,655 type: 'sent', outboxId: m.id, to_handle: m.to_handle, to_actor: m.to_actor, to_actors: m.to_actors, 656 656 in_reply_to: m.in_reply_to, post_slug: m.post_slug, content: m.content, 657 657 editable: m.editable, language: m.language, created_at: m.created_at, … … 785 785 // onbeantwoord bericht leest. 786 786 t.mine = t.messages.some((m) => m.type === 'sent'); 787 // Waar gaat een antwoord uit deze draad heen? Twee paden, en ze sluiten 788 // elkaar uit: hangt de draad aan een post, dan antwoord je op het NIEUWSTE 789 // ontvangen bericht erin (dat is de parent van de thread) -- anders is het 790 // een direct bericht aan de tegenpartij. 791 const inkomend = t.messages.filter((m) => m.type !== 'sent'); 792 const laatste = inkomend[inkomend.length - 1]; 793 t.replyTo = { 794 interactionId: (laatste && laatste.interactionId) || null, 795 postSlug: (t.post && t.post.slug) || null, 796 actorUri: (laatste && (laatste.actorUri || laatste.url)) 797 || (t.messages.find((m) => m.to_actor) || {}).to_actor 798 || (() => { try { return JSON.parse((t.messages.find((m) => m.to_actors) || {}).to_actors || '[]')[0] || null; } catch { return null; } })(), 799 }; 787 800 } 788 801 return out; … … 4429 4442 try { 4430 4443 const rows = db.prepare(` 4431 SELECT i. kind, i.actor_name, i.actor_handle, i.actor_url, i.actor_icon, i.content, i.created_at, i.published, i.visibility,4444 SELECT i.id AS interaction_id, i.kind, i.actor_uri, i.actor_name, i.actor_handle, i.actor_url, i.actor_icon, i.content, i.created_at, i.published, i.visibility, 4432 4445 i.emoji_json, i.actor_emoji_json, i.media_json, i.quote_json, i.embed_json, 4433 4446 p.slug AS post_slug, p.title AS post_title … … 4438 4451 for (const r of rows) out.push({ 4439 4452 type: r.kind, name: r.actor_name, handle: r.actor_handle, url: r.actor_url, icon: r.actor_icon, 4453 // Waar een antwoord uit de draad heen moet: het id is de parent voor 4454 // deliverReply, de uri het adres voor een direct bericht. 4455 interactionId: r.interaction_id, actorUri: r.actor_uri, 4440 4456 content: stripLeadingMentions(r.content), post_slug: r.post_slug, post_title: r.post_title, created_at: r.created_at, 4441 4457 // When the post was written, for display. created_at (when it reached us) … … 4671 4687 getOutboxRow: (id) => iStmts().getO.get(id), 4672 4688 buildReplyNote, AP_CONTEXT, getOrCreateKeys, deliver, enqueueDelivery, 4689 // Rijke directe berichten: dezelfde sanitizer als deliverReply gebruikt, zodat 4690 // een antwoord uit Berichten door precies één poort gaat. 4691 sanitizeHtml: (h) => HtmlSanitizerService.sanitize(h), 4692 htmlToPlainText: (h) => HtmlSanitizerService.toPlainText(h), 4673 4693 }); 4674 4694 /**
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)