summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-10 18:36:27 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-10 18:36:27 +0000
commit4840b1575faf405a35bd11bfc18843bda5047d81 (patch)
treeb838acb691e6db55d6267ef535d4670f6aa63cca /src
parent9fffa58c203e37ff9a6cb853d40ce33a6edef6ea (diff)
downloadirssi-4840b1575faf405a35bd11bfc18843bda5047d81.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/irc-servers.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index f678777b..ef8a21ee 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -416,21 +416,15 @@ static int sig_set_user_mode(IRC_SERVER_REC *server)
newmode = server->usermode == NULL ? NULL :
modes_join(server->usermode, mode, FALSE);
- if (server->usermode == NULL) {
- /* server didn't set user mode, just set the new one */
- irc_send_cmdv(server, "MODE %s %s", server->nick, mode);
- } else if (strcmp(newmode, server->usermode) != 0) {
- if (server->connrec->reconnection) {
- /* when reconnecting, we want to set exactly the
- same mode we had before reconnect */
- args = g_strdup_printf("%s -%s+%s", server->nick,
- server->usermode, mode);
- } 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);
+ if (newmode == NULL || strcmp(newmode, server->usermode) != 0) {
+ /* change the user mode. we used to do some trickery to
+ get rid of unwanted modes at reconnect time, but that's
+ more trouble than worth. (eg. we don't want to remove
+ some good default server modes, but we don't want to
+ set back +r, etc..) */
+ args = g_strdup_printf("%s %s", server->nick, mode);
+ signal_emit("command mode", 3, args, server, NULL);
+ g_free(args);
}
g_free_not_null(newmode);