Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cblgh
Last active May 19, 2022 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cblgh/19a226eac92fc57cdaf1ebc2a013ce21 to your computer and use it in GitHub Desktop.
Save cblgh/19a226eac92fc57cdaf1ebc2a013ce21 to your computer and use it in GitHub Desktop.

general function docs for the interfaces of cabal-client: api docs

the file we'll likely serialize the out-of-log storage is client.js

file containing channel related logic & state channel-details.js

  • PMs are represented just like regular channels, except populated with messages from a different type of emitted event, see channel-details.js#L215
  • PM channels can't be renamed (the name of the channel is the public key of the person you are chatting with atm)
  • cabal-details.js contains the brunt of the logic for cabal-client's interactions. this is the place to remove a logic guard when you want enable leaving of PMs: cabal-details.js#L519-L521
    • you will not want to emit a channel/leave message or otherwise log this in cabal-core using this.core.publish(leaveMsg, ...), but instead implement custom logic to change the state of the private channel instance + persist that state in the out-of-log store
  • the out of log store could be as simple as a json object that's saved to disk at a useful location; once we have it, it will be used for local state stuff like remembering which messages are unread in which channels, or (maybe) storing private moderation actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment