mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Update README.md
This commit is contained in:
parent
88e694d0c1
commit
5ff65b1c5c
1 changed files with 57 additions and 0 deletions
57
README.md
57
README.md
|
@ -41,3 +41,60 @@ These are the commands currently implemented:
|
|||
|
||||
6. Open your browser
|
||||
`http://localhost:9000`
|
||||
|
||||
## Events
|
||||
Using [Socket.IO](http://socket.io/)
|
||||
Events sent from the __server__ to the __browser__:
|
||||
```javascript
|
||||
// Event: "join"
|
||||
// Sent when joining a new channel/query.
|
||||
socket.emit("join", {
|
||||
id: 0,
|
||||
chan: {
|
||||
id: 0,
|
||||
name: "",
|
||||
type: "",
|
||||
messages: [],
|
||||
users: [],
|
||||
}
|
||||
});
|
||||
|
||||
// Event: "msg"
|
||||
// Sent when receiving a message.
|
||||
socket.emit("msg", {
|
||||
id: 0,
|
||||
msg: {
|
||||
time: "",
|
||||
type: "",
|
||||
from: "",
|
||||
text: "",
|
||||
}
|
||||
});
|
||||
|
||||
// Event: "networks"
|
||||
// Sent upon connecting to the server.
|
||||
socket.emit("networks", {
|
||||
networks: [{
|
||||
id: 0,
|
||||
host: "",
|
||||
nick: "",
|
||||
channels: [],
|
||||
}]
|
||||
});
|
||||
|
||||
// Event: "part"
|
||||
// Sent when leaving a channel/query.
|
||||
socket.emit("part", {
|
||||
id: 0
|
||||
});
|
||||
|
||||
// Event: "users"
|
||||
// Sent whenever the list of users changes.
|
||||
socket.emit("users", {
|
||||
id: 0,
|
||||
users: [{
|
||||
mode: "",
|
||||
name: "",
|
||||
}]
|
||||
});
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue