This PR adds support for cabal-core's private message functionality in a few different ways:
a new CabalDetails.publishPrivateMessage function has been added
CabalDetails.getPrivateMessageList returns a list of channel names corresponding to ongoing PMs for the local user
CabalDetails.isChannelPrivate(channel) returns true if the passed in channel is a private message channel, false otherwise
CabalDetails.publishMessage now redirects a published message to publishPrivateMessage if it is used to post a message to a private message channel
A new convention was introduced to limit malicious use in clients: Channel names conforming to the hypercore public key format are forbidden in cabal-client as names for regular channel names (i.e. no channel names that are 64 hex characters)—these are restricted to private channels only (namely: one per person you are chatting with, the name being their public key (or yours, from their perspective))
publish-private-message, private-message events are now emitted
the PMChannelDetails has been added to enable support for private message channels with minimal duplicated functionality
CabalDetails.getChannels(opts) was extended with an option includePM to include private message channels in the returned result
PMs are moderation aware: if you hide a user the channel is hidden and no subsequent PMs will be displayed in your client
This PR adds support for cabal-core's private message functionality in a few different ways:
CabalDetails.publishPrivateMessage
function has been addedCabalDetails.getPrivateMessageList
returns a list of channel names corresponding to ongoing PMs for the local userCabalDetails.isChannelPrivate(channel)
returns true if the passed in channel is a private message channel, false otherwiseCabalDetails.publishMessage
now redirects a published message topublishPrivateMessage
if it is used to post a message to a private message channelpublish-private-message
,private-message
events are now emittedPMChannelDetails
has been added to enable support for private message channels with minimal duplicated functionalityCabalDetails.getChannels(opts)
was extended with an optionincludePM
to include private message channels in the returned resultDepends on https://github.com/cabal-club/cabal-core/pull/108
cc @substack @hackergrrl detailed or superficial reviews would be appreciated ^_^