Changeset 6c152a5 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 07/28/2026 08:15:31 PM (6 weeks ago)
- Branches:
- main
- Children:
- 6eab7e9
- Parents:
- 742ba7e
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r742ba7e r6c152a5 1376 1376 // Accept/Reject answers an offer a local guardian sent. Anything the 1377 1377 // guardianship module does not recognize falls through to the old paths. 1378 if (type === 'Offer' || type === 'Accept' || type === 'Reject') { 1378 // An Undo of the guardianship Relationship (§3.2) is handled here too, and it 1379 // must be seen BEFORE the generic Undo branch below, which only knows about 1380 // Follow/Like/Announce and would swallow it with a 202. 1381 if (type === 'Offer' || type === 'Accept' || type === 'Reject' || (type === 'Undo' && Guardianship.parseUndoRelationship(act))) { 1379 1382 // Every LOCAL party this activity is addressed to gets its own copy of the 1380 1383 // handshake (a ward and a co-guardian may both live here). Gather candidate … … 1385 1388 if (typeof t === 'string') { const s = slugFromActorUrl(t); if (s) cand.add(s); } 1386 1389 } 1387 if (type === 'Offer' ) {1388 const rel = Guardianship.parseRelationship(act.object);1390 if (type === 'Offer' || type === 'Undo') { 1391 const rel = type === 'Undo' ? Guardianship.parseUndoRelationship(act) : Guardianship.parseRelationship(act.object); 1389 1392 if (rel) { const s = slugFromActorUrl(rel.ward); if (s) cand.add(s); } 1390 1393 } … … 3769 3772 offer_for_ward: ['push.n_guard_cog_t', 'push.n_guard_cog_b'], // I co-guard this ward 3770 3773 committed: ['push.n_guard_ward_t', 'push.n_guard_ward_b'], 3774 // §3.2: a guardian ended the relation. The ward hears that someone who 3775 // was looking after them has gone; a co-guardian hears they are one fewer. 3776 guardian_left: ['push.n_guard_left_t', 'push.n_guard_left_b'], 3777 coguardian_left: ['push.n_guard_cogleft_t', 'push.n_guard_cogleft_b'], 3771 3778 }[ev.kind]; 3772 3779 if (!texts) return; 3773 const who = deriveHandle(ev.candidate || ev. ward || ev.guardian|| '') || '?';3774 const url = ev.kind === 'offer_received'? `${pushPrefix(slug)}/messages` : '/guardian';3780 const who = deriveHandle(ev.candidate || ev.guardian || ev.ward || '') || '?'; 3781 const url = (ev.kind === 'offer_received' || ev.kind === 'guardian_left') ? `${pushPrefix(slug)}/messages` : '/guardian'; 3775 3782 pushEvent(slug, { type: 'guardian', title: i18nT(L, texts[0]), body: i18nT(L, texts[1], { who }), url }); 3776 3783 },
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)