cabal-club / cabal-client Goto Github PK
View Code? Open in Web Editor NEWinterface for writing peer-to-peer chat clients
License: GNU General Public License v3.0
interface for writing peer-to-peer chat clients
License: GNU General Public License v3.0
I think it makes sense to bundle channel archiving within the current mods/admins system. It could be used to clean-up channel listings from accidentally made channels, or to hide vulgarly named channels.
Question: where does this functionality make the most sense—in cabal-client or cabal-core?
Example commands:
/archive <channel>
/unarchive <channel> (alt. /restore <channel>)
/archives (lists all archived channels, the archiver (good idea?), and the stated reason for archiving)
older issue on this topic: #16
It would be nice to have a mechanism to export a portable snapshot of the database (in json?) for backups or migration to another cabal.
And likewise, it would be nice to have a way to import a dataset into a cabal.
Saw this today on the public cabal:
14:59:39 <eea2c604> oops, does the help message display for the whole channel, or just me?
I've found this confusing too at different times. Weechat, for example, will show status messages ONLY in the status buffer. I think this makes sense for command output like /help
and /channels
in particular.
If a user goes offline then receives messages do they see them when back online and can they then deal with them and delete them after?
with the advent of the https://github.com/cabal-club/cabal-bot github integration, i found a need to mute notifications / new channel activity
that is, i want to be able to peek at the github
channel, at the same time i don't want it to show that it has new messages, or that i have been mentioned in it. it's just a bit stressful / not useful for channels with a lot of activity and/or automated feeds as in the github integration case
There are loads of methods in the README . If I were to rewrite these as JSDoc strings in the code, then set up an npm task for building documentation HTML, would that be useful work? It might make developing against this a bit easier (enabling intellisense etc).
Then your unread state would be maintained across multiple clients and computers (if we eventually implement sameAs
to link those accounts together)
Also then we'll know what messages have been read by others. Clients could show read receipts in the UI, which is really nice to have in smaller channels.
i think one way to get started with the cabal-client interface is to simply export a javascript object which can save various settings in its keys
module.exports = {}
...
var client = require("cabal-client")
client["cabal-desktop"] = {notifications: "none"}
mainly writing this down as a note for myself for an upcoming evening of implementation :)
Are the cabal-core and the swarm also being terminated? Otherwise it'll continue peering and indexing.
(If this is non-trivial, we can make an issue & a future PR!)
Originally posted by @noffle in https://github.com/_render_node/MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjc2Mjg4OTYz/pull_request_reviews/more_threads
Just a thought: eventually it'd be great if we could move out the networking elsewhere, maybe a pluggable set of modules, so that regardless of whether you're doing node/electron/web/mobile, you can use the discovery methods that work for that platform.
Originally posted by @noffle in https://github.com/_render_node/MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjc2Mjg4OTYz/pull_request_reviews/more_threads
This way each client doesn't need to implement emotes, etc
Cabal client is still a bit rough to get going with, people resort to reading the cabal-cli source as the canonical documentation.
One thing that could help is extracting the logic for joining many cabals, which is a common enough usecase that it should just be supported outright.
from cli
var pendingCabals = args.new ? [client.createCabal()] : keys.map(client.addCabal.bind(client))
Promise.all(pendingCabals).then(() => { /* do stuff */ })
cf #4, i'm anticipating the need for settings so that people can e.g. choose the granularity of their notifications (no notifications; respectful (new message|mentions); full-on push notifications)
like @cinnamon-bun discussed we can save this in cabal-client on a per-client basis
The output from the /help
command is pretty massive.
By refactoring it, we could split it into segments such as:
investigate why information from different cabals seem to exhibit the behaviour of being merged into one and the same (e.g. look at one cabal, see the information from another cabal you have data stored from locally)
could be that something more needs to be set on https://github.com/random-access-storage/random-access-web to get the desired behaviour
try to replicate
I know cabal is based on Dat and Dat has an sdk that is supposed to work for browsers.
Would cabal-client work for browsers too? Any plans to provide a build?
See discussion on cabal-club/cabal-core#110.
This should be possible, but cabal-core is the main dependency for cabal-client. If cabal-core doesn't have type declarations, type declarations for cabal-client will be much worse, or possibly completely broken.
On a client, calling functions like cabalDetails.getUsers()
immediately after the init
event would return an empty set of users/channels/etc. Waiting a few seconds, then cabalDetails.getUsers() does have content.
from @okdistribute:
ideally this should be a 'ready' event from some lower-level module, i bet it will need to come from the indexer -- which should already be there somewhere. a timeout will give different results on different computers, slow computers or those with spinning disks might not be able to complete the necessary steps in 2 seconds with large cabals
Ideally configurable, it would be useful to see in the chat history when people join and leave channels you're in. For cabal-client, this could be events, or virtual messages like the moderation status messages we do.
cblgh:
i've been dreaming lately of integrating paperslip, my hyperswarm sharing thing, into cabal-clientso to share a cabal key in cabal desktop you would just like
/share nicks-secret-gang
then you shout across the room or send me a text "HEY JOIN
nicks-secret-gang
IN THAT INPUT BOX!" and i do that in my cabal-desktopso i use that phrase as a [hyperswarm] topic by which the cabal key is transmitted
nick: and take the phrase and set it as the alias for convenience
i want to manage which channels come up in listings, and invite people to them so that they don't miss out on its existence. cabal-client
should implement functionality to make the following operations possible in the cli:
/hide <channel-name>
which hides it when i list /channels
, unless a flag is present e.g. /channels --all
/archive <channel-name>
which hides it for everyone when they list /channel
a message could be printed in the channel:
cblgh has archived this channel. type /unarchive to restore
/invite <pubkey> <channel-name>
where pubkey is the peer i want to invite to <channel-name>
/invite <nick> <channel-name>
where every peer that currently has the name <nick>
is invitedSomething like
client.getSettings()
client.saveSettings(settingsObject)
Where settingsObject
is an arbitrary JSONable object.
This would be for local client settings like notification options, color themes or light mode vs dark mode, auto-emojification, etc.
Are all clients on a machine meant to share the same local storage for their Client instances?
If not, they could specify a name so they could have their own separate local storages.
var client = Client(cabal, "my-awesome-client")
we recently had a pr that added a much-welcomed settings file (#89) however, as @khubo recently realized, this is fudging up cabal when used in the browser!
so we need to extract the settings logic into something that can work in the browser. so rather operate on the path using something that relies on the random-access-* ecosystem (like we're already doing in src/storage-node.js
/ src/storage-browser.js
)
see cabal-client-files for @nikolaiwarner initial implementation
mostly ux ideas
Ideally we'll want to show messages from several cabal-core views:
Currently, the count of unread messages is not persisted. Because of that, unread notifications will vanish after a restart. This would be nice to have, maybe as an opt-in.
Might have a loose connection to #45.
Right now we only show notifications for moderation actions when the person doing the action is a mod/admin of yours. I think it would also be nice to know:
cc @RangerMauve, who brought this up.
if we have a method that takes a user name and returns a list of public keys i'm thinking it can be used for a facility that allows for inviting users into channels e.g.
/invite <name> <list of channel names>
extracted from #16 :
/invite where pubkey is the peer i want to invite to
or /invite where every peer that currently has the name is invited
multiple peers should be able to be invited at the same time too, and with autocomplete for nicks
Something like
client.searchMessages({
// various optional query settings:
text: 'blah', // case-insensitive substring match or fuzzy match
channel: 'foo', // limit to one channel?
author: 'bar', // limit to one author?
})
--> list or stream of matching messages, most recent first
e.g.
> /appears-as
Sees you as an admin:
cblgh.abcd
Sees you as a moderator:
foo.a123
Sees you as hidden:
bax.dff2
It would be great to have something like https://github.com/kappa-db/workshop but for writing your own client with cabal-client. A small set of clearly delineated examples would help, too :)
Something like https://github.com/cabal-club/cabal-bot is a good start :~
thanks @timgoeller for the idea :)
Haven't had the time yet to really check why this happens, but it seems to be caused by this commit: 1dbd522 (everything works when I revert these changes locally)
If I join a cabal I will receive all historical messages, but not any of the new messages (or at least the event won't be triggered for new messages). This happens even when I join these channels after I've joined the cabal.
As demonstrated by hypervision it is possible to stream video over hypercores. This has wondrous implications for a chat application like Cabal, as it makes possible group voice chats à la TeamSpeak, and video chats à la Zoom or Jitsi, all P2P.
See also: #15
Provide some helper functions to convert between actual emojis and :emoji_codes:
for clients to use when posting or when displaying.
See this issue in cabal commons for details
khubo and nick, and myself while starting to patch cabal-irc, have felt a need to have more granular listeners than on("update")
as an example: this method, from cabal-desktop, would be split up into several listeners
i haven't had a sit down to think properly about which ones yet but maybe:
"new message", channel
"join/leave channel", channel
does this need to be disambiguated? one event type for the person who is running the client; the other event type for when other peers join or leave specific channels?"nick change", {userkey, newnick}
"topic", channel, topic
, maybe just a channel state changed event? that includes new people joining/leaving and topics changing."initialization"
, this fires basically when all data is available after first starting up a client. it is only triggered onceit could also be interesting to include a delta, the change in state that occurred in the current update, that can optionally be used (that way client implementations don't necessarily need to be in a reactive framework like react or vue. introducing a delta could however cause weird errors stemming from out of order updates.
@khubo @nikolaiwarner chime in on your recent impressions and thoughts when developing cabal-desktop so excellently these past 2-3 weeks. which specific cases were aching for more granular listeners?
steps to reproduce:
Currently all events are at cabal level, and there is no events emitted for adding/joining/removing cabal etc. It would be dope if we could have some events for the same at client level. Events on top of my head is:
see #50 for the files needed to document
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.