- return clients;
-}
-
-/* Finds client entry by nickname. */
-
-SilcClientEntry
-silc_idlist_find_client_by_nickname(SilcIDList id_list, char *nickname,
- char *server, SilcIDCacheEntry *ret_entry)
-{
- SilcIDCacheList list = NULL;
- SilcIDCacheEntry id_cache = NULL;
- SilcClientEntry client = NULL;
-
- SILC_LOG_DEBUG(("Client by nickname"));
-
- if (server) {
- if (!silc_idcache_find_by_data(id_list->clients, nickname, &list))
- return NULL;
-
-#if 0
- while (silc_idcache_list_next(list, &id_cache)) {
- client = (SilcClientEntry)id_cache->context;
-
- if (!strcmp(server, XXX, strlen(server)))
- break;
-
- client = NULL;
- }
-#endif
-
- silc_idcache_list_free(list);
-
- if (!client)
- return NULL;
- } else {
- if (!silc_idcache_find_by_data_one(id_list->clients, nickname, &id_cache))
- return NULL;
-
- client = (SilcClientEntry)id_cache->context;
-
- if (ret_entry)
- *ret_entry = id_cache;
- }
-
- SILC_LOG_DEBUG(("Found"));
-
- return client;
-}
-
-/* Finds client by nickname hash. */
-
-SilcClientEntry
-silc_idlist_find_client_by_hash(SilcIDList id_list, char *nickname,
- SilcHash md5hash, SilcIDCacheEntry *ret_entry)
-{
- SilcIDCacheList list = NULL;
- SilcIDCacheEntry id_cache = NULL;
- SilcClientEntry client = NULL;
- unsigned char hash[32];
-
- SILC_LOG_DEBUG(("Client by hash"));
-
- silc_hash_make(md5hash, nickname, strlen(nickname), hash);
-
- if (!silc_idcache_find_by_id(id_list->clients, SILC_ID_CACHE_ANY,
- SILC_ID_CLIENT, &list))
- return NULL;
-
- if (!silc_idcache_list_first(list, &id_cache)) {
- silc_idcache_list_free(list);
- return NULL;
- }
-
- while (id_cache) {
- client = (SilcClientEntry)id_cache->context;
-
- if (client && !SILC_ID_COMPARE_HASH(client->id, hash))
- break;
-
- id_cache = NULL;
- client = NULL;
-
- if (!silc_idcache_list_next(list, &id_cache))
- break;
- }
-
- silc_idcache_list_free(list);
-
- if (ret_entry)
- *ret_entry = id_cache;
-
- SILC_LOG_DEBUG(("Found"));
-
- return client;