1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00

Changed again behaviour of resetting user modes when reconnecting to server,

it was also buggy and didn't work.. Anyway, now we don't anymore even try to
remove "non-wanted" modes set by server when reconnecting, if you really
don't want to have some mode, set it with -x in /set usermode.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2304 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-10 18:36:27 +00:00 committed by cras
parent 9fffa58c20
commit 4840b1575f

View File

@ -416,21 +416,15 @@ static int sig_set_user_mode(IRC_SERVER_REC *server)
newmode = server->usermode == NULL ? NULL : newmode = server->usermode == NULL ? NULL :
modes_join(server->usermode, mode, FALSE); modes_join(server->usermode, mode, FALSE);
if (server->usermode == NULL) { if (newmode == NULL || strcmp(newmode, server->usermode) != 0) {
/* server didn't set user mode, just set the new one */ /* change the user mode. we used to do some trickery to
irc_send_cmdv(server, "MODE %s %s", server->nick, mode); get rid of unwanted modes at reconnect time, but that's
} else if (strcmp(newmode, server->usermode) != 0) { more trouble than worth. (eg. we don't want to remove
if (server->connrec->reconnection) { some good default server modes, but we don't want to
/* when reconnecting, we want to set exactly the set back +r, etc..) */
same mode we had before reconnect */ args = g_strdup_printf("%s %s", server->nick, mode);
args = g_strdup_printf("%s -%s+%s", server->nick, signal_emit("command mode", 3, args, server, NULL);
server->usermode, mode); g_free(args);
} else {
/* allow using modes the server gave us */
args = g_strdup_printf("%s -%s", server->nick, mode);
}
signal_emit("command mode", 3, server, args, NULL);
g_free(args);
} }
g_free_not_null(newmode); g_free_not_null(newmode);