X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fcommand_reply.c;h=dee4e0bef9bcd7a1838c08a96a06445caec96082;hb=386c883d8774999c6e74d7c6c37e52e4163a4cb1;hp=d9fbe6a8e603c85027c532c6714fffd6673b0540;hpb=38685840f29a35f1dab68be00406e1c90808def0;p=silc.git diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index d9fbe6a8..dee4e0be 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -895,8 +895,8 @@ SILC_SERVER_CMD_REPLY_FUNC(join) /* The entry exists. */ /* If ID has changed, then update it to the cache too. */ - if (!SILC_ID_CHANNEL_COMPARE(channel->id, id)) - silc_idlist_replace_channel_id(server->local_list, channel->id, id); + if (!SILC_ID_CHANNEL_COMPARE(entry->id, id)) + silc_idlist_replace_channel_id(server->local_list, entry->id, id); entry->disabled = FALSE; @@ -917,26 +917,21 @@ SILC_SERVER_CMD_REPLY_FUNC(join) /* Get the ban list */ tmp = silc_argument_get_arg_type(cmd->args, 8, &len); if (tmp) { - if (entry->ban_list) - silc_free(entry->ban_list); - entry->ban_list = silc_calloc(len, sizeof(*entry->ban_list)); - memcpy(entry->ban_list, tmp, len); + silc_free(entry->ban_list); + entry->ban_list = silc_memdup(tmp, len); } /* Get the invite list */ tmp = silc_argument_get_arg_type(cmd->args, 9, &len); if (tmp) { - if (entry->invite_list) - silc_free(entry->invite_list); - entry->invite_list = silc_calloc(len, sizeof(*entry->invite_list)); - memcpy(entry->invite_list, tmp, len); + silc_free(entry->invite_list); + entry->invite_list = silc_memdup(tmp, len); } /* Get the topic */ tmp = silc_argument_get_arg_type(cmd->args, 10, &len); if (tmp) { - if (entry->topic) - silc_free(entry->topic); + silc_free(entry->topic); entry->topic = strdup(tmp); } @@ -1204,6 +1199,8 @@ SILC_SERVER_CMD_REPLY_FUNC(list) cache->expire = time(NULL) + 60; } + channel->user_count = usercount; + if (topic) { silc_free(channel->topic); channel->topic = strdup(topic);