From: Jochen Eisinger Date: Thu, 14 Nov 2002 18:37:48 +0000 (+0000) Subject: Thu Nov 14 19:33:28 CET 2002 Jochen Eisinger X-Git-Tag: silc.server.0.9.6~47 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=52dcfd40622f8267ce6efb613d809fd098a55901 Thu Nov 14 19:33:28 CET 2002 Jochen Eisinger * Never format your own nick. Closes #63 --- diff --git a/CHANGES b/CHANGES index 992adc73..59ff6151 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Thu Nov 14 19:33:28 CET 2002 Jochen Eisinger + + * Print "nick now appears as newnick" and update Irssi's nicklist + when you change your nick to "nick". Closes #62 + * Never format your own nick. Closes #63 + Thu Nov 14 09:44:54 CET 2002 Jochen Eisinger * SILC_UMODE_GONE changes are now propagated correctly to the diff --git a/lib/silcclient/idlist.c b/lib/silcclient/idlist.c index cd48b287..6c015ef5 100644 --- a/lib/silcclient/idlist.c +++ b/lib/silcclient/idlist.c @@ -1134,6 +1134,20 @@ void silc_client_nickname_format(SilcClient client, if (!len || freebase) return; + if (clients_count == 1) + unformatted = clients[0]; + else + for (i = 0; i < clients_count; i++) + if (!strncasecmp(clients[i]->nickname, client_entry->nickname, + strlen(clients[i]->nickname))) + unformatted = clients[i]; + + /* If we are changing nickname of our local entry we'll enforce + that we will always get the unformatted nickname. Give our + format number to the one that is not formatted now. */ + if (unformatted && client_entry == conn->local_entry) + client_entry = unformatted; + cp = client->internal->params->nickname_format; while (*cp) { if (*cp == '%') { @@ -1196,15 +1210,10 @@ void silc_client_nickname_format(SilcClient client, char tmp[6]; int num, max = 1; - if (clients_count == 1) { - unformatted = clients[0]; + if (clients_count == 1) break; - } for (i = 0; i < clients_count; i++) { - if (!strncasecmp(clients[i]->nickname, client_entry->nickname, - strlen(clients[i]->nickname))) - unformatted = clients[i]; if (strncasecmp(clients[i]->nickname, newnick, off)) continue; if (strlen(clients[i]->nickname) <= off) @@ -1236,12 +1245,6 @@ void silc_client_nickname_format(SilcClient client, newnick = silc_realloc(newnick, sizeof(*newnick) * (off + 1)); newnick[off] = 0; - /* If we are changing nickname of our local entry we'll enforce - that we will always get the unformatted nickname. Give our - format number to the one that is not formatted now. */ - if (unformatted && client_entry == conn->local_entry) - client_entry = unformatted; - silc_free(client_entry->nickname); client_entry->nickname = newnick; silc_free(clients);