Scuttle Invite
Polymorphic invite and reply logic for Secure Scuttlebutt.
You're hosting a gathering and all your favourite hermit crabs want to attend. You create a gathering on Patchbay. But wait. Hhw can you send a message to everyone telling them about it? Its a bit laborious to expect them all to just know, and a new reference thread could easily get lost. Have no fear!
Scuttle Invite provides an easy-to-use set of functions that allow you to invite and reply to any given root
record in your database. Simply pass the gathering key / message ID as the { root }
in the publish parameters. To reply to an invite, make sure you pass the root ID again, and the branch ID (the invite).
How to use:
const invites = const params = body: `My fellow Hermies, come cluster at the official opening of Crabland, we'll be cracking open a few bottles of bubbly` root: rootIdinvitesasyncprivate
To reply to an invite:
const invites = const replyParams = body: 'glass of milk?' root: rootIdinvitesasyncprivate
See the tests for more examples...
API
async: private: publish reply publish reply getInvite getReply canReply isAcceptedpull: allByRoot invitesByRoot repliesByRootsync: isInvite isReply