Skip to content
Julien Savard edited this page Mar 22, 2015 · 1 revision

This document describes the client-server protocol used by WalrusIRC. It uses the same database (plus a few extensions), checkLogin.php and IRC relay as OmnomIRC, so they can be used together using the same data (actually, it's recommended as it can serve as a failover for WalrusIRC), but the browser-server communication slightly differs.

This software makes use of the Socket.IO library, the protocol is therefore mainly composed of socket.on(event, function(data){}) and socket.emit(event, data) events. Parameters (passed in data) are always passed in the form of a JSON object.

Server Events

Those are events the server sends and the client recieves.

message, action, topic, join, part, quit, kick, mode, nick

Parameters: One line from the irc_lines table, in JSON format.

The client should add one line to the chat window, formatted depending of the type. Depending of the event, it should also send a userlist event (join, part, quit, kick, nick), update the topic bar (topic) or add the line to the sent line history (message, action).

The server usually send them when a lastlines or lastcurid event is recieved or when the omnomirc_curid file on the server changes.

topics

Parameters: topic: The current topic.

The client should update the topic bar with the current topic. Usually sent on loading.

scroll

Parameters: None.

The client should scroll the window to the bottom. Usually sent after each message or message batch.

disconnect, reconnect

Those events are sent by the socket.io library itself, they should be used to tell the user whether the client is connected to the server or not. Useful in case the server goes down or the user loses their Internet access.

auth

userlist

settings

file

Client Events

Those are events the client sends and the server recieves.

settings

lastlines

lastcurid

userlist

auth

message

join

part

file