X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_notify.c;h=44ae2fbe62e37861f49cf8edb87f58765e7a0cb8;hb=3d55ce97cb6f26917ec10a805d32641d6c86ecf8;hp=ce8204e2b6065f8beff0ef2837de7bec64b35706;hpb=3304e90317ca1ddc3c3301bdca6257f1f35da9e8;p=silc.git diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index ce8204e2..44ae2fbe 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -506,10 +506,11 @@ void silc_client_notify_by_server(SilcClient client, goto out; /* Find Client entry */ - client_entry = - silc_client_get_client_by_id(client, conn, client_id); - if (!client_entry) + client_entry = silc_client_get_client_by_id(client, conn, client_id); + if (!client_entry) { + silc_client_notify_by_server_resolve(client, conn, packet, client_id); goto out; + } /* Get the mode */ tmp = silc_argument_get_arg_type(args, 2, &tmp_len); @@ -591,11 +592,14 @@ void silc_client_notify_by_server(SilcClient client, /* Get the channel entry */ if (!silc_idcache_find_by_id_one(conn->channel_cache, (void *)channel_id, - &id_cache)) + &id_cache)) break; channel = (SilcChannelEntry)id_cache->context; + SILC_LOG_DEBUG(("Old Channel ID id(%s)", + silc_id_render(channel->id, SILC_ID_CHANNEL))); + /* Free the old ID */ silc_free(channel->id); @@ -607,7 +611,13 @@ void silc_client_notify_by_server(SilcClient client, if (!channel->id) goto out; - id_cache->id = (void *)channel->id; + SILC_LOG_DEBUG(("New Channel ID id(%s)", + silc_id_render(channel->id, SILC_ID_CHANNEL))); + + /* Remove the old cache entry and create a new one */ + silc_idcache_del_by_context(conn->channel_cache, channel); + silc_idcache_add(conn->channel_cache, channel->channel_name, + channel->id, channel, FALSE); /* Notify application */ client->ops->notify(client, conn, type, channel, channel);