X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcclient%2Fcommand_reply.c;h=9a8b9fe6b1b82837e610accd5193b05a7737af4c;hp=228dce57f1cddb43724a392b7a504b73e4b009e4;hb=e5d8d3db6caa344b3d419b884556c21b15e7d123;hpb=8d1a8bbf644f67f86e7e1b95cf51d6d49406251f diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index 228dce57..9a8b9fe6 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -963,6 +963,11 @@ SILC_CLIENT_CMD_REPLY_FUNC(join) /* Get topic */ topic = silc_argument_get_arg_type(cmd->args, 10, NULL); + /* If we have the channel entry, remove it and create a new one */ + channel = silc_client_get_channel(cmd->client, conn, channel_name); + if (channel) + silc_client_del_channel(cmd->client, conn, channel); + /* Save received Channel ID. This actually creates the channel */ channel = silc_client_new_channel_id(cmd->client, cmd->sock, channel_name, mode, idp); @@ -1256,7 +1261,7 @@ SILC_CLIENT_CMD_REPLY_FUNC(cumode) SilcClientEntry client_entry; SilcChannelEntry channel; SilcChannelUser chu; - unsigned char *tmp, *id; + unsigned char *modev, *tmp, *id; uint32 len, mode; SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL)); @@ -1268,8 +1273,8 @@ SILC_CLIENT_CMD_REPLY_FUNC(cumode) } /* Get channel mode */ - tmp = silc_argument_get_arg_type(cmd->args, 2, NULL); - if (!tmp) { + modev = silc_argument_get_arg_type(cmd->args, 2, NULL); + if (!modev) { COMMAND_REPLY_ERROR; goto out; } @@ -1320,7 +1325,8 @@ SILC_CLIENT_CMD_REPLY_FUNC(cumode) client_entry = (SilcClientEntry)id_cache->context; /* Save the mode */ - SILC_GET32_MSB(mode, tmp); + SILC_GET32_MSB(mode, modev); + silc_list_start(channel->clients); while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) { if (chu->client == client_entry) { chu->mode = mode;