+ switch (query->querycmd) {
+
+ case SILC_COMMAND_WHOIS:
+ break;
+
+ case SILC_COMMAND_WHOWAS:
+ for (i = 0; i < clients_count; i++) {
+ client_entry = clients[i];
+
+ /* Check if cannot query this anyway, so take next one */
+ if (!client_entry || !client_entry->router)
+ continue;
+
+ /* If both nickname and username are present no resolving is needed */
+ if (client_entry->nickname && client_entry->username)
+ continue;
+
+ /* Resolve the detailed client information */
+ silc_server_query_resolve(server, query,
+ client_entry->router->connection,
+ client_entry);
+ }
+ break;
+
+ case SILC_COMMAND_IDENTIFY:
+ for (i = 0; i < clients_count; i++) {
+ client_entry = clients[i];
+
+ /* Check if cannot query this anyway, so take next one */
+ if (!client_entry || !client_entry->router)
+ continue;
+
+ if (client_entry->nickname ||
+ !(client_entry->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
+ /* If we are router, client is local to us, or client is on channel
+ we do not need to resolve the client information. */
+ if (server->server_type != SILC_SERVER || SILC_IS_LOCAL(client_entry)
+ || silc_hash_table_count(client_entry->channels))
+ continue;
+ }
+
+ /* Resolve the detailed client information */
+ silc_server_query_resolve(server, query,
+ client_entry->router->connection,
+ client_entry);
+ }
+ break;
+ }
+
+ /* If we didn't have to do any resolving, continue with sending the
+ command reply to the original sender. */
+ if (!query->num_query)
+ silc_server_query_send_reply(server, query, clients, clients_count,
+ servers, servers_count, channels,
+ channels_count);
+
+ silc_free(clients);
+ silc_free(servers);
+ silc_free(channels);
+}
+
+/* Resolve the detailed information for the `client_entry'. Only client
+ information needs to be resolved for being incomplete. Each incomplete
+ client entry calls this function to do the resolving. */
+
+void silc_server_query_resolve(SilcServer server, SilcServerQuery query,
+ SilcSocketConnection sock,
+ SilcClientEntry client_entry)
+{
+#if 0
+ SilcUInt16 ident;
+
+ if (!sock)
+ return;
+
+ if (client_entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
+ /* The entry is being resolved by some other external query already.
+ Attach to that query instead of resolving again. */
+ ident = client_entry->resolve_cmd_ident;
+ silc_server_command_pending(server, SILC_COMMAND_NONE, ident,
+ silc_server_query_resolve_reply, query);
+ } else {
+ ident = ++server->cmd_ident;
+
+ switch (query->querycmd) {
+
+ case SILC_COMMAND_WHOIS:
+ case SILC_COMMAND_IDENTIFY:
+ break;
+
+ case SILC_COMMAND_WHOWAS:
+ /* We must send WHOWAS command since it's the only the way of
+ resolving clients that are not present in the network anymore. */
+ silc_server_send_command(server, sock, query->querycmd, ident, 1,
+ 1, query->nickname, strlen(query->nickname));
+ break;
+ }
+
+ silc_server_command_pending(server, query->querycmd, ident,
+ silc_server_query_resolve_reply, query);
+ }
+
+ /* Mark the entry as being resolved */
+ client_entry->data.status |= SILC_IDLIST_STATUS_RESOLVING;
+ client_entry->data.status &= ~SILC_IDLIST_STATUS_RESOLVED;
+ client_entry->resovle_cmd_ident = ident;
+
+ /* Save the query information, which we will reprocess after we
+ get this and all other queries back. */
+ query->ids = silc_realloc(query->ids, sizeof(*query->ids) *
+ (query->ids_count + 1));
+ if (query->ids) {
+ query->ids[query->ids_count].id = silc_id_dup(id, id_type);
+ query->ids[query->ids_count].id_type = id_type;
+ query->ids[query->ids_count].ident = ident;
+ query->ids_count++;
+ }
+ query->num_query++;
+#endif
+}
+
+/* Reply callback called after one resolving has been completed. If
+ all resolvings has been received then we will continue with sending
+ the command reply to the original sender of the query. */
+
+void silc_server_query_resolve_reply(void *context, void *reply)
+{
+ SilcServerQuery query = context;
+
+
+}
+
+void silc_server_query_send_reply(SilcServer server,
+ SilcServerQuery query,
+ SilcClientEntry *clients,
+ SilcUInt32 clients_count,
+ SilcServerEntry *servers,
+ SilcUInt32 servers_count,
+ SilcChannelEntry *channels,
+ SilcUInt32 channels_count)
+{