From c8524b6076d322107bef3de1449c45bcaec7b7aa Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 25 Sep 2020 22:14:26 +0200 Subject: protocol: Version 3 (self-invite on create_room; leave_room) --- protocol.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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`. +- ` leave_room ` + - 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`. - ` invite ` @@ -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 ` + - 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. -- cgit v1.2.3-54-g00ecf