diff options
author | Timo Sirainen <cras@irssi.org> | 2000-05-10 11:29:55 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-05-10 11:29:55 +0000 |
commit | 749640e7934f2a5dc3b19f39743b4a77591cd811 (patch) | |
tree | f7f552b471f11bbcab08975303fe732be4160df2 /src | |
parent | 240df09c4573cca520a3074138e74ee2999778f2 (diff) | |
download | irssi-749640e7934f2a5dc3b19f39743b4a77591cd811.zip |
/MODE was buggy
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@207 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/core/modes.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index bd31d3ab..95549a4d 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -328,7 +328,7 @@ void channel_set_singlemode(IRC_SERVER_REC *server, const char *channel, const c void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *mode) { - char *modestr, *curmode, type, *orig; + char *modestr, *curmode, *orig; GString *tmode, *targs; int count; @@ -338,17 +338,12 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *m tmode = g_string_new(NULL); targs = g_string_new(NULL); - type = '+'; count = 0; + count = 0; orig = modestr = g_strdup(mode); curmode = cmd_get_param(&modestr); for (; *curmode != '\0'; curmode++) { - if (*curmode == '+' || *curmode == '-') { - type = *curmode; - continue; - } - if (count == server->connrec->max_modes && MODE_HAS_ARG(*curmode)) { irc_send_cmdv(server, "MODE %s %s%s", channel, tmode->str, targs->str); @@ -483,7 +478,9 @@ static void cmd_mode(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item) } if (*target == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); - if (ischannel(*target)) + if (*mode == '\0') + irc_send_cmdv(server, "MODE %s", target); + else if (ischannel(*target)) channel_set_mode(server, target, mode); else irc_send_cmdv(server, "MODE %s %s", target, mode); |