Changeset 189e335 in Klonkt for src/services/guardianship/delivery.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/guardianship/delivery.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/delivery.js
r99a7b40 r189e335 41 41 // guardian on any instance receives it as a private mention (the ward 42 42 // call-for-help path). 43 export async function deliverDirectNote(site, { recipients, text, language, inReplyTo, attachments, helpRequest, wave, awayUntil }) {43 export async function deliverDirectNote(site, { recipients, text, html, language, inReplyTo, attachments, helpRequest, wave, awayUntil }) { 44 44 const { actorId, fetchActor, localActor, deliverTo, deriveHandle, escHtml, linkUrls, linkHashtags, 45 45 getOutboxRow, buildReplyNote, AP_CONTEXT, getOrCreateKeys, deliver, enqueueDelivery } = deps; … … 83 83 return `<a href="${escHtml(r.url)}" class="u-url mention" data-actor="${escHtml(r.uri)}">${escHtml(disp)}</a> `; 84 84 }).join(''); 85 // Rijk antwoord: `html` is de HTML uit de reply-editor, hier gesaneerd; `text` 86 // blijft de platte versie (het `source`-veld en de no-JS-fallback). Levert de 87 // sanitizer niets bruikbaars op, dan valt hij terug op de escaped tekst -- 88 // een leeggepoetste editor mag geen leeg bericht versturen. 89 const richClean = html ? deps.sanitizeHtml(String(html)) : ''; 90 const rich = richClean && deps.htmlToPlainText(richClean).trim() ? richClean : ''; 85 91 const body = escHtml(String(text).trim()).replace(/\r?\n/g, '<br>'); 86 const content = `<p>${mention}${linkUrls(linkHashtags(base, body))}</p>`; 92 // De mention-anker blijft een eigen alinea vooraan: de ontvanger moet in het 93 // bericht genoemd staan, ook als de rijke inhoud met een kop of lijst begint. 94 const content = rich 95 ? `<p>${mention}</p>${linkUrls(linkHashtags(base, rich))}` 96 : `<p>${mention}${linkUrls(linkHashtags(base, body))}</p>`; 87 97 const lang = /^[a-z]{2,3}(-[A-Za-z0-9-]+)?$/.test(String(language || '')) ? language : null; 88 98 // Attachments: same rules as deliverReply (own /media/ uploads only,
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)