summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-05 21:26:29 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-05 21:26:29 +0000
commitab337e8de0b72e14135dd614fca947c12e268325 (patch)
tree73d36d8ba1e94b8e3aeb170c6fd50d94a8019b32 /src
parent381f74a26e749c686a7edc9c2ec5ee5fa3cf4061 (diff)
Backport of r2531, reset +r on registered channels after a netmerge when our creation time is newer than what we recieved
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2533 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/channels.c b/src/channels.c
index d37c79e9a..0d957c32e 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -820,10 +820,20 @@ void do_sjoin(const char *source, int ac, char **av)
cumodes[2] = cu->user->nick;
chan_set_modes(source, c, 3, cumodes, 2);
}
- if (c->ci && c->ci->bi) {
- /* This is ugly, but it always works */
- anope_cmd_part(c->ci->bi->nick, c->name, "TS reop");
- bot_join(c->ci);
+ if (c->ci)
+ {
+ if (c->ci->bi)
+ {
+ /* This is ugly, but it always works */
+ anope_cmd_part(c->ci->bi->nick, c->name, "TS reop");
+ bot_join(c->ci);
+ }
+ /* Make sure +r is set */
+ if (ircd->chanreg && ircd->regmode)
+ {
+ c->mode |= ircd->regmode;
+ anope_cmd_mode(whosends(c->ci), c->name, "+r");
+ }
}
/* XXX simple modes and bans */
} else if (c->creation_time < ts)
@@ -1864,11 +1874,20 @@ Channel *join_user_update(User * user, Channel * chan, 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 */
- anope_cmd_part(chan->ci->bi->nick, chan->name, "TS reop");
- bot_join(chan->ci);
+ if (chan->ci->bi)
+ {
+ /* This is ugly, but it always works */
+ anope_cmd_part(chan->ci->bi->nick, chan->name, "TS reop");
+ bot_join(chan->ci);
+ }
+ /* Make sure +r is set */
+ if (ircd->chanreg && ircd->regmode)
+ {
+ chan->mode |= ircd->regmode;
+ anope_cmd_mode(whosends(chan->ci), chan->name, "+r");
+ }
}
/* XXX simple modes and bans */
}