Application provides the following message channels:


which are pretty self-explanatory.

Here is detailed explanation of what each channel does and data types:


Example from js:

    type: 'new-message',
    session_key: '{{ request.session.session_key }}',
    username: opponent_username,
    message: message

In the handler, a new Message object is created and the received packet along with the additional parameters is sene to the other user’s websocket (if present)

packet['created'] = msg.get_formatted_create_datetime()
packet['sender_name'] = msg.sender.username
packet['message_id'] =

Sends connected client list of currently active users.

# Get list list of current active users
users = [
    {'username': username, 'uuid': uuid_str}
    for username, uuid_str in ws_connections.values()

# Make packet with list of new users (sorted by username)
packet = {
    'type': 'users-changed',
    'value': sorted(users, key=lambda i: i['username'])

Informs the users when someone of other has gone online.

{‘type’: ‘gone-online’, ‘usernames’: [user_owner.username]}

Distributes the users ‘gone offline’ status to everyone he has dialog with {‘type’: ‘gone-offline’, ‘username’: user_owner.username}
Same as online, except that it is used to provide the user that has gone online with information about who of his dialogs’ users is online.

Shows message to opponent if the user is typing a message

{‘type’: ‘opponent-typing’, ‘username’: user_opponent}


Send message to user if the opponent has read the message Also sets the to True.

{‘type’: ‘opponent-read-message’, ‘username’: user_opponent, ‘message_id’: message_id}