summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-12 12:03:00 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-12 12:03:00 +0000
commite6bf76ed1177f753bbb85dbe77952b82358a76f6 (patch)
tree5835ceacb87b4512d580d120c867d5cb3c412188 /src
parent66e8aa2c74fd98e8c593cbb97c21cace27d0c4b2 (diff)
downloadirssi-e6bf76ed1177f753bbb85dbe77952b82358a76f6.zip
Don't try to set alternate_nick to any default value, it's not very useful
and it didn't work properly if nick was 9 chars with last char being '_' (not very likely though :). Also handle properly the situation where nick and alternate_nick are the same. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2311 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/irc-nicklist.c5
-rw-r--r--src/irc/core/irc-servers-setup.c13
2 files changed, 3 insertions, 15 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c
index 9de3febc..ef410277 100644
--- a/src/irc/core/irc-nicklist.c
+++ b/src/irc/core/irc-nicklist.c
@@ -255,8 +255,9 @@ static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
}
/* nick already in use - need to change it .. */
- if (strcmp(server->nick, server->connrec->nick) == 0 &&
- server->connrec->alternate_nick != NULL) {
+ if (g_strcasecmp(server->nick, server->connrec->nick) == 0 &&
+ server->connrec->alternate_nick != NULL &&
+ g_strcasecmp(server->connrec->alternate_nick, server->nick) != 0) {
/* first try, so try the alternative nick.. */
g_free(server->nick);
server->nick = g_strdup(server->connrec->alternate_nick);
diff --git a/src/irc/core/irc-servers-setup.c b/src/irc/core/irc-servers-setup.c
index 8606a470..e661083a 100644
--- a/src/irc/core/irc-servers-setup.c
+++ b/src/irc/core/irc-servers-setup.c
@@ -112,19 +112,6 @@ static void init_userinfo(void)
nick = settings_get_str("nick");
}
- /* alternate nick */
- set = settings_get_str("alternate_nick");
- if (set == NULL || *set == '\0') {
- if (strlen(nick) < 9)
- str = g_strconcat(nick, "_", NULL);
- else {
- str = g_strdup(nick);
- str[strlen(str)-1] = '_';
- }
- settings_set_str("alternate_nick", str);
- g_free(str);
- }
-
/* host name */
set = settings_get_str("hostname");
if (set == NULL || *set == '\0') {