1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

/mode #channel -oooo... would deop the first 3, and then op the rest.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@636 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-29 19:26:05 +00:00 committed by cras
parent cc5ad03e4e
commit 18a0499ce7

View File

@ -446,7 +446,7 @@ void channel_set_singlemode(IRC_SERVER_REC *server, const char *channel,
void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
const char *mode)
{
char *modestr, *curmode, *orig, type;
char *modestr, *curmode, *orig, type, prevtype;
GString *tmode, *targs;
int count;
@ -459,22 +459,28 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
orig = modestr = g_strdup(mode);
type = '+';
type = '+'; prevtype = '\0';
curmode = cmd_get_param(&modestr);
for (; *curmode != '\0'; curmode++) {
if (*curmode == '+' || *curmode == '-')
if (*curmode == '+' || *curmode == '-') {
type = *curmode;
continue;
}
if (count == server->max_modes_in_cmd &&
HAS_MODE_ARG(type, *curmode)) {
irc_send_cmdv(server, "MODE %s %s%s",
channel, tmode->str, targs->str);
count = 0;
count = 0; prevtype = '\0';
g_string_truncate(tmode, 0);
g_string_truncate(targs, 0);
}
if (type != prevtype) {
prevtype = type;
g_string_append_c(tmode, type);
}
g_string_append_c(tmode, *curmode);
if (HAS_MODE_ARG(type, *curmode)) {