imc: a small fix in #join
authorJan Janak <janakj@cs.columbia.edu>
Wed, 20 Feb 2019 15:40:24 +0000 (10:40 -0500)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 26 Feb 2019 16:24:33 +0000 (17:24 +0100)
When a user has left or been removed from a room and try to join
again, make sure to test the IMC_MEMBER_DELETED flag, otherwise they'd
be getting a message that they are already in the room.

src/modules/imc/imc_cmd.c

index 34e58ab..c06e331 100644 (file)
@@ -454,7 +454,7 @@ int imc_handle_join(struct sip_msg* msg, imc_cmd_t *cmd,
        LM_DBG("Found room [%.*s]\n", STR_FMT(&rm->uri));
 
        member = imc_get_member(rm, &src->parsed.user, &src->parsed.host);
-       if (member) {
+       if (member && !(member->flags & IMC_MEMBER_DELETED)) {
                LM_DBG("User [%.*s] is already in the room\n", STR_FMT(&member->uri));
                imc_send_message(&rm->uri, &member->uri, &all_hdrs, &msg_already_joined);
                goto done;