Online and offline status

ChatEngine generates $.online.* and $.offline.* events for each user when they join or leave chat rooms. These events can be consumed by other users in the chat room to show online/offline status.

Listen to $.online events

ChatEngine.on('$.online.*', (payload) => {
    appendMessage('Status', payload.user.uuid + ' is in this room!');
});

Listen to $.offline events

chat.on('$.offline.*', (payload) => {
    console.log('User left the room:', payload.user);
});