diff options
-rw-r--r-- | command.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -32,6 +32,11 @@ static bool cmd_login(struct conn_data *data,const char *tag,const char **args){ i64 userid=db_find_user(args[0]); if(userid==-1){ net_send_error(data->fd,tag,"User not found"); + if(data->userid!=-1){ + userdata_unregister(data->userid,data->fd); + broadcast_online_change(data->userid); + data->userid=-1; + } return false; } char *pass=db_get_pass(userid); |