Changeset fc40410 in Klonkt for src/services/guardianship
- Timestamp:
- 07/28/2026 07:43:47 AM (6 weeks ago)
- Branches:
- main
- Children:
- b258a79
- Parents:
- 6bc2e31b
- Location:
- src/services/guardianship
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/index.js
r6bc2e31b rfc40410 16 16 */ 17 17 export { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship } from './context.js'; 18 export { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians } from './notes.js';18 export { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians, externalEmbedsAllowed } 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
r6bc2e31b rfc40410 15 15 try { return (slug && listGuardians(slug).length) ? { 'shaer:hasGuardians': true } : {}; } 16 16 catch { return {}; } 17 } 18 19 /** 20 * May EXTERNAL (non-fediverse) embeds be shown to this account? 21 * 22 * A gated feature in the FEP-633c sense: a ward's world outside the fediverse 23 * is the guardians' call. `setting` is `sites.external_embeds`: 24 * null/undefined → auto: off for a ward, on for anyone else 25 * 0 → off, 1 → on (the guardians decided) 26 * 27 * Pure, so the rule is testable on its own. The gate is applied SERVER-side: 28 * a blocked embed is never serialised into the feed, because an embed that the 29 * client merely hides has still been delivered. 30 */ 31 export function externalEmbedsAllowed(setting, isWard) { 32 if (setting === 0 || setting === 1) return setting === 1; 33 return !isWard; 17 34 } 18 35 … … 48 65 } 49 66 50 export default { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians };67 export default { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians, externalEmbedsAllowed };
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)