|
|
@@ -345,7 +345,7 @@ static void check_exemptlist(struct chanset_t *chan, char *from)
|
|
|
flush_mode(chan, QUICK);
|
|
|
}
|
|
|
|
|
|
-void priority_do(struct chanset_t * chan, bool opsonly, int action)
|
|
|
+static void priority_do(struct chanset_t * chan, bool opsonly, int action, bool flush = 1)
|
|
|
{
|
|
|
if (!me_op(chan))
|
|
|
return;
|
|
|
@@ -411,7 +411,8 @@ void priority_do(struct chanset_t * chan, bool opsonly, int action)
|
|
|
++sent;
|
|
|
add_mode(chan, '-', 'o', m->nick);
|
|
|
if (!floodless && (actions >= ct || (n == 1 && sent > 20))) {
|
|
|
- flush_mode(chan, QUICK);
|
|
|
+ if (flush)
|
|
|
+ flush_mode(chan, QUICK);
|
|
|
return;
|
|
|
}
|
|
|
} else if ((action == PRIO_KICK) && !chan_sentkick(m)) {
|
|
|
@@ -1194,10 +1195,10 @@ void check_this_user(char *hand, int del, char *host)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void enforce_bitch(struct chanset_t *chan) {
|
|
|
+static void enforce_bitch(struct chanset_t *chan, bool flush = 1) {
|
|
|
if (!chan || !me_op(chan))
|
|
|
return;
|
|
|
- priority_do(chan, 1, PRIO_DEOP);
|
|
|
+ priority_do(chan, 1, PRIO_DEOP, flush);
|
|
|
}
|
|
|
|
|
|
void enforce_closed(struct chanset_t *chan) {
|
|
|
@@ -1389,6 +1390,7 @@ void recheck_channel(struct chanset_t *chan, int dobans)
|
|
|
memberlist *m = NULL;
|
|
|
struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0 };
|
|
|
int stop_reset = 0, botops = 0, nonbotops = 0, botnonops = 0;
|
|
|
+ bool flush = 0;
|
|
|
|
|
|
++stacking;
|
|
|
|
|
|
@@ -1415,8 +1417,10 @@ void recheck_channel(struct chanset_t *chan, int dobans)
|
|
|
putlog(LOG_MISC, "*", "Opped in %s, not checking +closed/+bitch until more bots arrive.", chan->dname);
|
|
|
} else {
|
|
|
/* if the chan is +closed, mass deop first, safer that way. */
|
|
|
- if (chan_bitch(chan) || channel_closed(chan))
|
|
|
- enforce_bitch(chan);
|
|
|
+ if (chan_bitch(chan) || channel_closed(chan)) {
|
|
|
+ flush = 1;
|
|
|
+ enforce_bitch(chan, 0);
|
|
|
+ }
|
|
|
|
|
|
if (channel_closed(chan))
|
|
|
enforce_closed(chan);
|
|
|
@@ -1427,21 +1431,7 @@ void recheck_channel(struct chanset_t *chan, int dobans)
|
|
|
|
|
|
/* This is a bad hack for +e/+I */
|
|
|
if (dobans == 2 && chan->channel.members > 1) {
|
|
|
- if (!(chan->status & (CHAN_ASKEDBANS|CHAN_HAVEBANS))) {
|
|
|
- chan->status |= CHAN_ASKEDBANS;
|
|
|
- dprintf(DP_MODE, "MODE %s +b\n", chan->name);
|
|
|
- }
|
|
|
- if (do_eI) {
|
|
|
- chan->channel.last_eI = now;
|
|
|
- if (!(chan->ircnet_status & CHAN_ASKED_EXEMPTS) && use_exempts == 1) {
|
|
|
- chan->ircnet_status |= CHAN_ASKED_EXEMPTS;
|
|
|
- dprintf(DP_MODE, "MODE %s +e\n", chan->name);
|
|
|
- }
|
|
|
- if (!(chan->ircnet_status & CHAN_ASKED_INVITES) && use_invites == 1) {
|
|
|
- chan->ircnet_status |= CHAN_ASKED_INVITES;
|
|
|
- dprintf(DP_MODE, "MODE %s +I\n", chan->name);
|
|
|
- }
|
|
|
- }
|
|
|
+ get_channel_masks(chan);
|
|
|
}
|
|
|
|
|
|
//Check +d/+O/+k
|
|
|
@@ -1476,13 +1466,19 @@ void recheck_channel(struct chanset_t *chan, int dobans)
|
|
|
if (channel_enforcebans(chan))
|
|
|
enforce_bans(chan);
|
|
|
}
|
|
|
- // Flush out mask changes
|
|
|
- flush_mode(chan, QUICK);
|
|
|
|
|
|
+ flush = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Do this here as the above only runs after already having been opped and having gotten bans.
|
|
|
+ if (dobans) {
|
|
|
if ((chan->status & CHAN_ASKEDMODES) && !channel_inactive(chan))
|
|
|
dprintf(DP_MODE, "MODE %s\n", chan->name);
|
|
|
recheck_channel_modes(chan);
|
|
|
}
|
|
|
+
|
|
|
+ if (flush)
|
|
|
+ flush_mode(chan, QUICK);
|
|
|
}
|
|
|
--stacking;
|
|
|
}
|
|
|
@@ -2428,7 +2424,8 @@ static int gotinvite(char *from, char *msg)
|
|
|
if (!chan)
|
|
|
/* Might be a short-name */
|
|
|
chan = findchan_by_dname(msg);
|
|
|
- else {
|
|
|
+
|
|
|
+ if (chan) {
|
|
|
if (channel_pending(chan) || channel_active(chan))
|
|
|
dprintf(DP_HELP, "NOTICE %s :I'm already here.\n", nick);
|
|
|
else if (shouldjoin(chan))
|