summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-04 21:54:35 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-04 21:54:35 +0000
commit70918d2a016c4910cce982a4520f5eb4ea992c0b (patch)
treedd0a491356920480ee3aeab708c438204298f78e
parentf553583f36254123792d01b90b5c168575d882cf (diff)
Reset +r on registered channels after a netmerge when our creation time is newer than what we recieved (TS reop)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2531 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/channels.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/channels.c b/src/channels.c
index c7913a752..45e196ea3 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -783,10 +783,20 @@ void do_sjoin(const char *source, int ac, const char **av)
modes[2] = cu->user->nick;
chan_set_modes(source, c, 3, modes, 2);
}
- if (c->ci && c->ci->bi) {
- /* This is ugly, but it always works */
- ircdproto->SendPart(c->ci->bi, c->name, "TS reop");
- bot_join(c->ci);
+ if (c->ci)
+ {
+ if (c->ci->bi)
+ {
+ /* This is ugly, but it always works */
+ ircdproto->SendPart(c->ci->bi, c->name, "TS reop");
+ bot_join(c->ci);
+ }
+ /* Make sure +r is set */
+ if (ircd->chanreg && ircd->regmode)
+ {
+ c->mode |= ircd->regmode;
+ ircdproto->SendMode(whosends(c->ci), c->name, "+r");
+ }
}
/* XXX simple modes and bans */
} else if (c->creation_time < ts)
@@ -1819,11 +1829,20 @@ Channel *join_user_update(User * user, Channel * chan, const char *name,
modes[2] = cu->user->nick;
chan_set_modes(s_OperServ, chan, 3, modes, 2);
}
- if (chan->ci && chan->ci->bi)
+ if (chan->ci)
{
- /* This is ugly, but it always works */
- ircdproto->SendPart(chan->ci->bi, chan->name, "TS reop");
- bot_join(chan->ci);
+ if (chan->ci->bi)
+ {
+ /* This is ugly, but it always works */
+ ircdproto->SendPart(chan->ci->bi, chan->name, "TS reop");
+ bot_join(chan->ci);
+ }
+ /* Make sure +r is set */
+ if (ircd->chanreg && ircd->regmode)
+ {
+ chan->mode |= ircd->regmode;
+ ircdproto->SendMode(whosends(chan->ci), chan->name, "+r");
+ }
}
/* XXX simple modes and bans */
}