Saltcorn 0.5.4 - real time chat rooms

By Tom Nielsen
Published on 13 September 2021

Real time chat rooms is the big new feature in 0.5.4. A room is a view that shows a series of messages and is updated in real time as new messages are added. Use these views for direct user-to-user message rooms awful message rooms related to wider discussion topics or groups of users.

A current limitation is that users have to be logged in with an account, so you can’t use this to chat to people visiting your homepage without them signing up. This restriction will be lifted in a future release

Room views are defined based on tables and views for messages – one view for showing a message and one view for entering a new message is required. Because it is based on standard tables and views, you can use the triggers and actions defined with blocks to listen out to messages from the user and insert new messages into the room. That way you can build simple chat bots

For further documentation, see the Wiki page on chat rooms

Other changes:

In List views, you can now set the width of each column, in px, %, vw etc, if the auto-width is not suitable.

Presets in now available in page fixed states. When you embed a view in a page, you choose whether the state is shared or fixed. If the state is shared, it comes from the query string. If the state is fixed, you enter the value for that state variable after building the page. In this release, you can now choose a preset value for a fixed state variable. This is particularly useful when using the LoggedIn preset for a user ID – this means you can now use a Show view on a page to show information related to the logged-in user.

User verified events: an event is now emitted when a user is verified. You can attach triggers to this event.

New Blocks added: 

  • Push items to lists
  • Run actions that have previously been declared as triggers – these have already been configured.
  • Create a row (that is, a JavaScript object) with a single key.
  • Delete rows in a database table by matching where condition.
  • Now: the current Date value
     

Recent posts


Hardc0l2e
/
3 months ago

tried the new room module and looks like a useful addon, I might try to use it with my current issue tracker system, replacing the old thread discussion by using the room view instead, currently trying it right now bind to a ticket_id, creating a unique room for the ticket owner and the assigned techsupport.

nome
/
3 months ago

Thanks Tom. Really apperciate the work