X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient.c;h=4674c0921b230087a9333778f49f46929b200e8e;hb=06de75789d7eb830f8358b1b784e82b9941b33c8;hp=a49973f429df5f64fd2c134465812ad440215ce2;hpb=17ede281c8884ab84ba8e0ba6e2f02253ada9d48;p=silc.git diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index a49973f4..4674c092 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -1525,12 +1525,15 @@ void silc_client_receive_new_id(SilcClient client, conn->local_entry->username = strdup(client->username); if (!conn->local_entry->hostname) conn->local_entry->hostname = strdup(client->hostname); - conn->local_entry->server = strdup(conn->remote_host); + if (!conn->local_entry->server) + conn->local_entry->server = strdup(conn->remote_host); conn->local_entry->id = conn->local_id; conn->local_entry->valid = TRUE; - conn->local_entry->channels = silc_hash_table_alloc(1, silc_hash_ptr, - NULL, NULL, - NULL, NULL, NULL, TRUE); + if (!conn->local_entry->channels) + conn->local_entry->channels = silc_hash_table_alloc(1, silc_hash_ptr, + NULL, NULL, + NULL, NULL, NULL, + TRUE); /* Put it to the ID cache */ silc_idcache_add(conn->client_cache, strdup(conn->nickname), conn->local_id, @@ -1575,6 +1578,7 @@ void silc_client_remove_from_channels(SilcClient client, silc_hash_table_del(chu->channel->user_list, chu->client); silc_free(chu); } + silc_hash_table_list_reset(&htl); }