#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_features.h"
+#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "list.h"
#include "struct.h"
#include "ircd_snprintf.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
modebuf_mode(mbuf, MODE_DEL | chptr->mode.mode); /* wipeout modes */
chptr->mode.mode &= MODE_BURSTADDED | MODE_WASDELJOINS;
+ /* wipe out modes not represented in chptr->mode.mode */
+ if (chptr->mode.limit) {
+ modebuf_mode_uint(mbuf, MODE_DEL | MODE_LIMIT, chptr->mode.limit);
+ chptr->mode.limit = 0;
+ }
+ if (chptr->mode.key[0]) {
+ modebuf_mode_string(mbuf, MODE_DEL | MODE_KEY, chptr->mode.key, 0);
+ chptr->mode.key[0] = '\0';
+ }
+ if (chptr->mode.upass[0]) {
+ modebuf_mode_string(mbuf, MODE_DEL | MODE_UPASS, chptr->mode.upass, 0);
+ chptr->mode.upass[0] = '\0';
+ }
+ if (chptr->mode.apass[0]) {
+ modebuf_mode_string(mbuf, MODE_DEL | MODE_APASS, chptr->mode.apass, 0);
+ chptr->mode.apass[0] = '\0';
+ }
+
parse_flags |= (MODE_PARSE_SET | MODE_PARSE_WIPEOUT); /* wipeout keys */
/* mark bans for wipeout */
banstr[banpos++] = *ptr;
newban = make_ban(ban); /* create new ban */
-
- DupString(newban->who,
- cli_name(feature_bool(FEAT_HIS_BANWHO) ? &me : sptr));
+ strcpy(newban->who, "*");
newban->when = TStime();
newban->flags = BAN_BURSTED; /* set flags */
current_mode_needs_reset = 0;
}
current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_VOICE;
- oplevel = -1; /* subsequential digits are an absolute op-level value. */
+ oplevel = -1; /* subsequent digits are an absolute op-level value. */
}
else if (isdigit(*ptr)) {
int level_increment = 0;
if (current_mode & CHFL_VOICE)
nickstr[nickpos++] = 'v';
if (current_mode & CHFL_CHANOP)
- nickpos += ircd_snprintf(0, nickstr + nickpos, sizeof(nickstr) - nickpos, "%u", oplevel);
+ {
+ if (chptr->mode.apass[0])
+ nickpos += ircd_snprintf(0, nickstr + nickpos, sizeof(nickstr) - nickpos, "%u", oplevel);
+ else
+ nickstr[nickpos++] = 'o';
+ }
} else if (current_mode & CHFL_CHANOP && oplevel != last_oplevel) { /* if just op level changed... */
nickstr[nickpos++] = ':'; /* add a specifier */
nickpos += ircd_snprintf(0, nickstr + nickpos, sizeof(nickstr) - nickpos, "%u", oplevel - last_oplevel);
modebuf_mode_client(mbuf, MODE_DEL | CHFL_CHANOP, member->user);
if (member->status & CHFL_VOICE)
modebuf_mode_client(mbuf, MODE_DEL | CHFL_VOICE, member->user);
- member->status = ((member->status & ~(CHFL_CHANOP | CHFL_VOICE)) |
- CHFL_DEOPPED);
+ member->status = (member->status
+ & ~(CHFL_CHANNEL_MANAGER | CHFL_CHANOP | CHFL_VOICE))
+ | CHFL_DEOPPED;
}
}
/* remove ban from channel */
if (lp->flags & (BAN_OVERLAPPED | BAN_BURST_WIPEOUT)) {
+ char *bandup;
+ DupString(bandup, lp->banstr);
modebuf_mode_string(mbuf, MODE_DEL | MODE_BAN,
- lp->banstr, 1); /* let it free banstr */
- lp->banstr = NULL; /* do not free this string */
+ bandup, 1);
*lp_p = lp->next; /* clip out of list */
free_ban(lp);
continue;