DEV Community

loading...

Progress: creating/deleting channels, switching active channel and chat history

wangonya profile image Kinyanjui Wangonya ・1 min read

My laptop died on me last week so things have been a bit slow. I have made a bit of progress since my last post though.

Creating/deleting channels

I added commands to enable creating and deleting channels.
/+channel channel_name creates a new channel.
newchan
/-channel channel_name deletes it.
delchan

Switching active channel

Now that we can create more channels, we'll likely want to switch between them to send messages to the right channel. Clicking on tab changes focus from the input field to the channels window. Channels are highlighted using the up and down keys and selected using enter.

Chat history

Selecting a new channel clears the screen and shows messages belonging to that channel. Chat history is saved in an in-memory sqlite3 database.
chat-history

Other changes

One more change I made was with the authentication. Previously, a user could log in from inside the app interface. Now, users have to log in to access the app.
auth1
After logging in for the first time, subsequent logins will be automatic.
auth2

Discussion

pic
Editor guide