assert(modes && modes[0] == '+');
while (*modes) {
switch (*modes++) {
+ case '-':
+ return -1;
case 'i':
result |= MODE_INVITEONLY;
break;
if (parv[param][0] != '+')
continue;
check_modes = netride_modes(parc - param, parv + param, chptr->mode.key);
- if (check_modes)
+ if (check_modes < 0)
+ {
+ if (chptr->users == 0)
+ sub1_from_channel(chptr);
+ return protocol_violation(sptr, "Invalid mode string in BURST");
+ }
+ else if (check_modes)
{
/* Clear any outstanding rogue invites */
mode_invite_clear(chptr);
current_mode_needs_reset = 0;
}
current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_CHANOP;
+ /*
+ * Older servers may send XXYYY:ov, in which case we
+ * do not want to use the code for 'v' below.
+ */
+ if (ptr[1] == 'v') {
+ current_mode |= CHFL_VOICE;
+ ptr++;
+ }
}
else if (*ptr == 'v') { /* has voice status */
if (current_mode_needs_reset) {
do {
level_increment = 10 * level_increment + *ptr++ - '0';
} while (IsDigit(*ptr));
+ --ptr;
oplevel += level_increment;
}
- else /* I don't recognize that flag */
+ else { /* I don't recognize that flag */
+ protocol_violation(sptr, "Invalid flag '%c' in nick part of burst", *ptr);
break; /* so stop processing */
+ }
}
}
}
last_oplevel = oplevel;
}
- if (IsBurst(sptr) || !(member = find_member_link(chptr, acptr)))
+ if (!(member = find_member_link(chptr, acptr)))
{
add_user_to_channel(chptr, acptr, current_mode, oplevel);
if (!(current_mode & CHFL_DELAYED))