- if (tmp) {
- /* Protocol version 1.1 */
- char *tmp_nick = NULL;
-
- /* Check whether nickname changed at all. It is possible that nick
- change notify is received but nickname didn't changed, only the
- ID changes. */
- if (client->internal->params->nickname_parse)
- client->internal->params->nickname_parse(client_entry->nickname,
- &tmp_nick);
- else
- tmp_nick = strdup(tmp);
-
- if (tmp_nick && !strcmp(tmp, tmp_nick)) {
- /* Nickname didn't change. Update only the ID */
- silc_idcache_del_by_context(conn->internal->client_cache,
- client_entry);
- silc_free(client_entry->id);
- client_entry->id = silc_id_dup(client_id, SILC_ID_CLIENT);
- silc_idcache_add(conn->internal->client_cache, strdup(tmp),
- client_entry->id, client_entry, 0, NULL);
-
- /* Notify application */
- client->internal->ops->notify(client, conn, type,
- client_entry, client_entry);
- break;
- }
- silc_free(tmp_nick);
-
- /* Create new client entry, and save all old information with the
- new nickname and client ID */
- client_entry2 = silc_client_add_client(client, conn, NULL, NULL,
- client_entry->realname,
- silc_id_dup(client_id,
- SILC_ID_CLIENT), 0);
- if (!client_entry2)
- goto out;
-
- if (client_entry->server)
- client_entry2->server = strdup(client_entry->server);
- if (client_entry->username)
- client_entry2->username = strdup(client_entry->username);
- if (client_entry->hostname)
- client_entry2->hostname = strdup(client_entry->hostname);
- silc_client_update_client(client, conn, client_entry2, tmp, NULL, NULL,
- client_entry->mode);
- } else {
- /* Protocol version 1.0 */