aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-08 11:48:42 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-08 11:48:42 +0200
commit9b44e7bee2ac20e51c785dd36c152365dca9ac5b (patch)
treea74e9e0ad363873060518d3bf8b791fad5c43a1f
parentc45ac5fe425e187d980b5593d7a4e3aa318e78fe (diff)
Send error if user already in room on invite
-rw-r--r--command.c4
1 files changed, 4 insertions, 0 deletions
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);