Check correctly for new/old nick change in NICK_CHANGE and create
authorPekka Riikonen <priikone@silcnet.org>
Tue, 26 Aug 2003 17:43:55 +0000 (17:43 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 26 Aug 2003 17:43:55 +0000 (17:43 +0000)
new entry if it changed (if only case changed).

lib/silcclient/client_notify.c

index 8b98b2ffb59d29b2e530f192b12635cb028adbe9..b5387ef345cc9b4befeb792eb3edce620bcf1491 100644 (file)
@@ -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);