diff options
Diffstat (limited to 'protocol.md')
-rw-r--r-- | protocol.md | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/protocol.md b/protocol.md index f3db156..7fc912a 100644 --- a/protocol.md +++ b/protocol.md @@ -1,4 +1,4 @@ -# tomsg protocol (version 2) +# tomsg protocol (version 3) The underlying transport of the protocol is a plain TCP socket. However, because private information is communicated, the recommended transport is an @@ -125,6 +125,20 @@ tomsg server. - Creates a new room, and enters the room. The id of the room is returned to the client. Returns an error if the client is not logged in. + If successful, all other sessions of the current user get a `_push invite` + push message for the new room with the current user (itself) as the + inviter. + + Also marks the current session as active. + - Returns `name` or `error`. +- `<tag> leave_room <roomname:word>` + - Leaves the room. Returns an error if the client is not logged in, or not in + that room. + + If successful, a `_push leave` push message is sent to all remaining room + members, as well as all other sessions of the current user. The message + contains the room left and the name of the current user. + Also marks the current session as active. - Returns `name` or `error`. - `<tag> invite <roomname:word> <user:word>` @@ -216,5 +230,9 @@ are listed below. - Sent to all sessions of all members of a room (except the session sending the `invite` command and all sessions of the invited user) in which a new user entered. +- `_push leave <roomname:word> <user:word>` + - When user X leaves room R, this push message is sent to: 1. all sessions of + all remaining users in room R, and 2. all sessions of user X that did were + not the one to send the initiating `leave_room` command. - `_push ping` - Sent by the server once in a while. Please ignore. |