Changeset e62f65d in Klonkt for src/services/guardianship
- Timestamp:
- 07/25/2026 08:01:21 AM (7 weeks ago)
- Branches:
- main
- Children:
- ad6f62a
- Parents:
- 5c373b8
- Location:
- src/services/guardianship
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/delivery.js
r5c373b8 re62f65d 40 40 // guardian on any instance receives it as a private mention (the ward 41 41 // call-for-help path). 42 export async function deliverDirectNote(site, { recipients, text, language, inReplyTo, attachments, helpRequest }) {42 export async function deliverDirectNote(site, { recipients, text, language, inReplyTo, attachments, helpRequest, wave }) { 43 43 const { actorId, fetchActor, deriveHandle, escHtml, linkUrls, linkHashtags, 44 44 getOutboxRow, buildReplyNote, AP_CONTEXT, getOrCreateKeys, deliver, enqueueDelivery } = deps; … … 70 70 .map((a) => ({ url: a.url, mediaType: String(a.mediaType), name: String(a.name || '').slice(0, 120) })); 71 71 const id = crypto.randomUUID(); 72 db.prepare(`INSERT INTO ap_outbox (id, site_slug, post_id, post_slug, in_reply_to, to_actor, to_handle, content, language, attachments, visibility, to_actors, help_request, created_at)73 VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?, CURRENT_TIMESTAMP)`)74 .run(id, site.slug, '', null, inReplyTo || null, resolved[0].uri, resolved[0].handle, content, lang, media.length ? JSON.stringify(media) : null, 'direct', JSON.stringify(resolved.map((r) => r.uri)), helpRequest ? 1 : 0 );72 db.prepare(`INSERT INTO ap_outbox (id, site_slug, post_id, post_slug, in_reply_to, to_actor, to_handle, content, language, attachments, visibility, to_actors, help_request, wave, created_at) 73 VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP)`) 74 .run(id, site.slug, '', null, inReplyTo || null, resolved[0].uri, resolved[0].handle, content, lang, media.length ? JSON.stringify(media) : null, 'direct', JSON.stringify(resolved.map((r) => r.uri)), helpRequest ? 1 : 0, wave ? 1 : 0); 75 75 const row = getOutboxRow(id); 76 76 const note = buildReplyNote(base, site, row); -
src/services/guardianship/index.js
r5c373b8 re62f65d 16 16 */ 17 17 export { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship } from './context.js'; 18 export { helpRequestProps, isHelpRequest } from './notes.js';18 export { helpRequestProps, isHelpRequest, waveProps, isWave } from './notes.js'; 19 19 export { wireDelivery, c2sVisibility, deliverDirectNote } from './delivery.js'; 20 20 export { wireHandshake, handleOutbox as handleGuardianshipOutbox, handleInbox as handleGuardianshipInbox, parseRelationship } from './handshake.js'; -
src/services/guardianship/notes.js
r5c373b8 re62f65d 18 18 } 19 19 20 export default { helpRequestProps, isHelpRequest }; 20 /** shaer:wave: a gentle "thinking of you" from a guardian to its ward. A 21 * private nudge, never a feed post; non-shaer clients see a plain DM. */ 22 export function waveProps(post) { 23 return (post && post.visibility === 'direct' && post.wave) 24 ? { 'shaer:wave': true } 25 : {}; 26 } 27 28 /** True when an incoming note is a wave. */ 29 export function isWave(object) { 30 return !!object && (object['shaer:wave'] === true || object.wave === true); 31 } 32 33 export default { helpRequestProps, isHelpRequest, waveProps, isWave };
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)