1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

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
This commit is contained in:
Timo Sirainen 2002-01-12 12:03:00 +00:00 committed by cras
parent 66e8aa2c74
commit e6bf76ed11
2 changed files with 3 additions and 15 deletions

View File

@ -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);

View File

@ -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') {