From 5460ab6beab7c39bdfd1a500423a53e468bd4630 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 26 Aug 2003 17:43:55 +0000 Subject: [PATCH] Check correctly for new/old nick change in NICK_CHANGE and create new entry if it changed (if only case changed). --- lib/silcclient/client_notify.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index 8b98b2ff..b5387ef3 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -623,11 +623,12 @@ void silc_client_notify_by_server(SilcClient client, goto out; /* Check whether nickname changed at all. It is possible that nick - change notify is received but nickname didn't changed, only the + change notify is received but nickname didn't change, only the ID changes. Check whether the hashes in the Client ID match, if they do nickname didn't change. */ - if (SILC_ID_COMPARE_HASH(client_entry->id, client_id)) { - /* Nickname didn't change. Update only the ID */ + if (SILC_ID_COMPARE_HASH(client_entry->id, client_id) && + !strcmp(tmp, client_entry->nickname)) { + /* Nickname didn't change. Update only Client ID. */ silc_idcache_del_by_context(conn->internal->client_cache, client_entry); silc_free(client_entry->id); -- 2.43.0