A zero-dependency AT Protocol Personal Data Server written in JavaScript
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add xyz.fake.inbox.getState endpoint

returns accepted and blocked DID lists for inbox state visibility

๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

zzstoatzz 2bd9419d 81e4b98c

+21
+21
src/pds.js
··· 1661 1661 method: 'POST', 1662 1662 handler: (pds, req, _url) => pds.handleInboxReject(req), 1663 1663 }, 1664 + '/xrpc/xyz.fake.inbox.getState': { 1665 + handler: (pds, _req, _url) => pds.handleInboxGetState(), 1666 + }, 1664 1667 }; 1665 1668 1666 1669 // โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— ··· 3447 3450 } 3448 3451 3449 3452 /** 3453 + * Get inbox state (accepted and blocked lists) 3454 + */ 3455 + handleInboxGetState() { 3456 + const accepted = this.sql 3457 + .exec('SELECT did FROM inbox_accepted') 3458 + .toArray() 3459 + .map((r) => r.did); 3460 + 3461 + const blocked = this.sql 3462 + .exec('SELECT did FROM inbox_blocked') 3463 + .toArray() 3464 + .map((r) => r.did); 3465 + 3466 + return Response.json({ accepted, blocked }); 3467 + } 3468 + 3469 + /** 3450 3470 * Verify session auth from Authorization header 3451 3471 * @param {Request} request 3452 3472 * @returns {Promise<{did: string} | null>} ··· 3924 3944 '/xrpc/xyz.fake.inbox.listRequests', 3925 3945 '/xrpc/xyz.fake.inbox.accept', 3926 3946 '/xrpc/xyz.fake.inbox.reject', 3947 + '/xrpc/xyz.fake.inbox.getState', 3927 3948 ]; 3928 3949 if (inboxAuthEndpoints.includes(url.pathname)) { 3929 3950 const auth = await requireAuth(request, env);