From 9b44e7bee2ac20e51c785dd36c152365dca9ac5b Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 8 Apr 2017 11:48:42 +0200 Subject: Send error if user already in room on invite --- command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command.c b/command.c index 13d8252..4e7180d 100644 --- a/command.c +++ b/command.c @@ -202,6 +202,10 @@ static bool cmd_invite(struct conn_data *data,const char *tag,const char **args) send_error(data->fd,tag,"Not in that room"); return false; } + if(db_is_member(roomid,user2)){ + send_error(data->fd,tag,"User already in that room"); + return false; + } db_add_member(roomid,user2); -- cgit v1.2.3-70-g09d2