Changeset 4c70ecb in Klonkt
- Timestamp:
- 07/21/2026 11:44:49 PM (7 weeks ago)
- Branches:
- main
- Children:
- 8b07c12
- Parents:
- fb30b5d
- Files:
-
- 1 added
- 2 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
-
test/c2s-block.test.js (added)
-
test/c2s-outbox.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rfb30b5d r4c70ecb 1965 1965 return { status: 202, url: actorUri }; 1966 1966 } 1967 // Shaer "in Orbit" = a real Block (FEP-c648 client side): lands in 1968 // ap_blocks, shows in the Block tab, and purges the actor's cached 1969 // content. Client-side filtering becomes a cache of this state. 1970 case 'Block': { 1971 const targetUri = c2sIdOf(object); 1972 if (!targetUri) return { status: 400, error: 'missing_object' }; 1973 const r = await blockTarget(site, targetUri); 1974 if (r && r.error) return { status: 400, error: r.error }; 1975 return { status: 202, url: targetUri }; 1976 } 1967 1977 case 'Undo': { 1968 1978 const inner = object && typeof object === 'object' ? object : null; … … 1971 1981 const innerTarget = c2sIdOf(inner && inner.object); 1972 1982 if (innerType === 'Follow') { await unfollowActor(site, innerTarget); return { status: 202, url: innerTarget }; } 1983 if (innerType === 'Block') { 1984 if (!innerTarget) return { status: 400, error: 'missing_object' }; 1985 unblock(site, innerTarget); // release from Orbit 1986 return { status: 202, url: innerTarget }; 1987 } 1973 1988 if (innerType === 'Like' || innerType === 'Announce') { 1974 1989 const kind = innerType === 'Announce' ? 'unboost' : 'unlike'; -
test/c2s-outbox.test.js
rfb30b5d r4c70ecb 67 67 68 68 test('Undo of an unknown inner type → 400', async () => { 69 const out = await AP.ingestOutboxActivity(site, user, { type: 'Undo', object: { type: 'Block', object: 'x' } }); 69 // Block used to be the unsupported example; it is real now (c2s-block.test). 70 const out = await AP.ingestOutboxActivity(site, user, { type: 'Undo', object: { type: 'Move', object: 'x' } }); 70 71 assert.equal(out.status, 400); 71 72 assert.equal(out.error, 'unsupported_undo');
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)