+ switch (id_type) {
+ case SILC_ID_CLIENT:
+ client_id = silc_id_payload_get_id(idp);
+
+ SILC_LOG_DEBUG(("Received client information"));
+
+ /* Check if we have this client cached already. */
+ client_entry = silc_client_get_client_by_id(cmd->client, conn, client_id);
+ if (!client_entry) {
+ SILC_LOG_DEBUG(("Adding new client entry"));
+ client_entry =
+ silc_client_add_client(cmd->client, conn, name, info, NULL,
+ silc_id_dup(client_id, id_type), 0);
+ } else {
+ silc_client_update_client(cmd->client, conn, client_entry,
+ name, info, NULL, 0);
+ }
+
+ if (client_entry->status & SILC_CLIENT_STATUS_RESOLVING)
+ client_entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
+
+ /* Notify application */
+ if (notify)
+ COMMAND_REPLY((ARGS, client_entry, name, info));
+ break;
+
+ case SILC_ID_SERVER:
+ server_id = silc_id_payload_get_id(idp);
+
+ SILC_LOG_DEBUG(("Received server information"));
+
+ /* Check if we have this server cached already. */
+ if (!silc_idcache_find_by_id_one(conn->server_cache,
+ (void *)server_id, &id_cache)) {
+ SILC_LOG_DEBUG(("Adding new server entry"));
+
+ server_entry = silc_calloc(1, sizeof(*server_entry));
+ server_entry->server_id = silc_id_dup(server_id, id_type);
+ if (name)
+ server_entry->server_name = strdup(name);
+ if (info)
+ server_entry->server_info = strdup(info);
+
+ /* Add server to cache */
+ silc_idcache_add(conn->server_cache, server_entry->server_name,
+ server_entry->server_id, (void *)server_entry,
+ 0, NULL);
+ } else {
+ server_entry = (SilcServerEntry)id_cache->context;
+ }
+
+ /* Notify application */
+ if (notify)
+ COMMAND_REPLY((ARGS, server_entry, name, info));
+ break;
+
+ case SILC_ID_CHANNEL:
+ channel_id = silc_id_payload_get_id(idp);
+
+ SILC_LOG_DEBUG(("Received channel information"));
+
+ /* Check if we have this channel cached already. */
+ channel_entry = silc_client_get_channel_by_id(client, conn, channel_id);
+ if (!channel_entry) {
+ if (!name)
+ break;
+
+ /* Add new channel entry */
+ channel_entry = silc_client_add_channel(client, conn, name, 0,
+ channel_id);
+ channel_id = NULL;
+ }
+
+ /* Notify application */
+ if (notify)
+ COMMAND_REPLY((ARGS, channel_entry, name, info));
+ break;