diff options
-rw-r--r-- | command.c | 4 | ||||
-rw-r--r-- | protocol.md | 5 |
2 files changed, 6 insertions, 3 deletions
@@ -188,11 +188,13 @@ static struct cmd_retval cmd_invite(struct conn_data *data,const char *tag,const db_add_member(roomid,user2); + const char *inviter_username=db_get_username(data->userid); + const char *username=args[1]; char *joinbuf=NULL; i64 joinbuflen=asprintf(&joinbuf,"_push join %s %s\n",roomname,username); char *invitebuf=NULL; - i64 invitebuflen=asprintf(&invitebuf,"_push invite %s\n",roomname); + i64 invitebuflen=asprintf(&invitebuf,"_push invite %s %s\n",roomname,inviter_username); event_emit_join(make_timestamp(),username,roomname); diff --git a/protocol.md b/protocol.md index d4c544b..346bfe4 100644 --- a/protocol.md +++ b/protocol.md @@ -182,8 +182,9 @@ are listed below. - `_push message <roomname:word> <user:word> <timestamp:i64> <msgid:i64> <message:string...>` - Sent to all sessions of all members of a room in which a message is posted, except the session that sent the message. -- `_push invite <roomname:word>` - - Sent to all sessions of the invited user after an `invite` command. +- `_push invite <roomname:word> <user:word>` + - Sent to all sessions of the invited user after an `invite` command. The + `<user>` parameter indicates who invited you to the given room. - `_push join <roomname:word> <user:word>` - Sent to all sessions of all members of a room (except the session sending the `invite` command) in which a new user entered. |