X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_prvmsg.c;h=9dc862141099d1fa5172677136133e067fc63f66;hb=9a85416f729ef965606a688fffb6baa9d22927a5;hp=45b785e211b495e111670542467775917a80b081;hpb=6394d86063413bc1c473723f3ef971840195bcd3;p=silc.git diff --git a/lib/silcclient/client_prvmsg.c b/lib/silcclient/client_prvmsg.c index 45b785e2..9dc86214 100644 --- a/lib/silcclient/client_prvmsg.c +++ b/lib/silcclient/client_prvmsg.c @@ -161,13 +161,11 @@ void silc_client_private_message(SilcClient client, goto out; /* Check whether we know this client already */ - if (!silc_idcache_find_by_id_one_ext(conn->client_cache, (void *)remote_id, - NULL, NULL, - silc_hash_client_id_compare, NULL, - &id_cache) || + remote_client = silc_client_get_client_by_id(client, conn, remote_id); + if (!remote_client || ((SilcClientEntry)id_cache->context)->nickname == NULL) { - if (id_cache && id_cache->context) { + if (remote_client) { remote_client = (SilcClientEntry)id_cache->context; if (remote_client->status & SILC_CLIENT_STATUS_RESOLVING) { remote_client->status &= ~SILC_CLIENT_STATUS_RESOLVING; @@ -183,8 +181,6 @@ void silc_client_private_message(SilcClient client, return; } - remote_client = (SilcClientEntry)id_cache->context; - /* Parse the payload and decrypt it also if private message key is set */ payload = silc_private_message_payload_parse(packet->buffer->data, packet->buffer->len,