aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-09-25 22:14:26 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-09-29 22:19:12 +0200
commitc8524b6076d322107bef3de1449c45bcaec7b7aa (patch)
tree51eb56e2b99e6730f4d2c37ba16437d393a67220
parent535566cf29c045a954dc87f6072ccf90da778818 (diff)
protocol: Version 3 (self-invite on create_room; leave_room)
-rw-r--r--protocol.md20
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.