From: Pekka Riikonen Date: Sun, 19 Oct 2003 20:28:32 +0000 (+0000) Subject: Remove client from channel before calling KICKED notify to app. X-Git-Tag: silc.client.0.9.14~18 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=51a8bcda9ad992b7f228fc3e5ea7d04a5cd85ffa Remove client from channel before calling KICKED notify to app. --- diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index 3a48ac15..ebda8bdc 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -1118,26 +1118,29 @@ void silc_client_notify_by_server(SilcClient client, /* Get comment */ tmp = silc_argument_get_arg_type(args, 2, &tmp_len); + /* Remove kicked client from channel */ + if (client_entry != conn->local_entry) { + chu = silc_client_on_channel(channel, client_entry); + if (chu) { + silc_hash_table_del(client_entry->channels, channel); + silc_hash_table_del(channel->user_list, client_entry); + silc_free(chu); + } + } + /* Notify application. The channel entry is sent last as this notify is for channel but application don't know it from the arguments sent by server. */ client->internal->ops->notify(client, conn, type, client_entry, tmp, client_entry2, channel); - /* Remove kicked client from channel */ + /* Remove kicked client (us) from channel */ if (client_entry == conn->local_entry) { /* If I was kicked from channel, remove the channel */ if (conn->current_channel == channel) conn->current_channel = NULL; silc_client_del_channel(client, conn, channel); } else { - chu = silc_client_on_channel(channel, client_entry); - if (chu) { - silc_hash_table_del(client_entry->channels, channel); - silc_hash_table_del(channel->user_list, client_entry); - silc_free(chu); - } - if (!silc_hash_table_count(client_entry->channels)) { SilcClientNotifyResolve res = silc_calloc(1, sizeof(*res)); res->context = client;