#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>
&& (!(check_modes & MODE_REGONLY) || IsAccount(member->user)))
continue;
sendcmdto_serv_butone(&me, CMD_KICK, NULL, "%H %C :Net Rider", chptr, member->user);
- sendcmdto_channel_butserv_butone(&me, CMD_KICK, chptr, NULL, 0, "%H %C :Net Rider", chptr, member->user);
+ sendcmdto_channel_butserv_butone(&his, CMD_KICK, chptr, NULL, 0, "%H %C :Net Rider", chptr, member->user);
make_zombie(member, member->user, &me, &me, chptr);
}
}
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 */
for (lp = chptr->banlist; lp; lp = lp->next)
- lp->flags |= CHFL_BURST_BAN_WIPEOUT;
+ lp->flags |= BAN_BURST_WIPEOUT;
/* clear topic set by netrider (if set) */
if (*chptr->topic) {
*chptr->topic = '\0';
*chptr->topic_nick = '\0';
chptr->topic_time = 0;
- sendcmdto_channel_butserv_butone(&me, CMD_TOPIC, chptr, NULL, 0,
+ sendcmdto_channel_butserv_butone(&his, CMD_TOPIC, chptr, NULL, 0,
"%H :%s", chptr, chptr->topic);
}
} else if (chptr->creationtime == timestamp) {
for (lp = chptr->banlist; lp; lp = lp->next) {
if (!ircd_strcmp(lp->banstr, ban)) {
ban = 0; /* don't add ban */
- lp->flags &= ~CHFL_BURST_BAN_WIPEOUT; /* not wiping out */
+ lp->flags &= ~BAN_BURST_WIPEOUT; /* not wiping out */
break; /* new ban already existed; don't even repropagate */
- } else if (!(lp->flags & CHFL_BURST_BAN_WIPEOUT) &&
+ } else if (!(lp->flags & BAN_BURST_WIPEOUT) &&
!mmatch(lp->banstr, ban)) {
ban = 0; /* don't add ban unless wiping out bans */
break; /* new ban is encompassed by an existing one; drop */
} else if (!mmatch(ban, lp->banstr))
- lp->flags |= CHFL_BAN_OVERLAPPED; /* remove overlapping ban */
+ lp->flags |= BAN_OVERLAPPED; /* remove overlapping ban */
if (!lp->next)
break;
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 = CHFL_BAN | CHFL_BURST_BAN; /* set flags */
- if ((ptr = strrchr(ban, '@')) && check_if_ipmask(ptr + 1))
- newban->flags |= CHFL_BAN_IPMASK;
-
+ newban->flags |= BAN_BURSTED;
newban->next = 0;
if (lp)
lp->next = newban; /* link it in */
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);
member->status |= CHFL_BURST_ALREADY_VOICED;
/* Synchronize with the burst. */
member->status |= CHFL_BURST_JOINED | (current_mode & (CHFL_CHANOP|CHFL_VOICE));
- member->oplevel = oplevel;
+ SetOpLevel(member, 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;
}
}
lp = *lp_p;
/* remove ban from channel */
- if (lp->flags & (CHFL_BAN_OVERLAPPED | CHFL_BURST_BAN_WIPEOUT)) {
+ 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;
- } else if (lp->flags & CHFL_BURST_BAN) /* add ban to channel */
+ } else if (lp->flags & BAN_BURSTED) /* add ban to channel */
modebuf_mode_string(mbuf, MODE_ADD | MODE_BAN,
lp->banstr, 0); /* don't free banstr */
- lp->flags &= (CHFL_BAN | CHFL_BAN_IPMASK); /* reset the flag */
+ lp->flags &= BAN_IPMASK; /* reset the flag */
lp_p = &(*lp_p)->next;
}
}