From a7ac6a0ac712892652da6dd8696b94d4c6d3ea84 Mon Sep 17 00:00:00 2001 From: Adam- Date: Sun, 13 Dec 2009 19:32:19 +0000 Subject: Added in a modestacker and rewrote almost all of the remaining old mode code git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2696 5417fbe8-f217-4b02-8779-1006273d7864 --- src/modules/cs_enforce.c | 10 ++-------- src/modules/cs_tban.c | 19 ++----------------- 2 files changed, 4 insertions(+), 25 deletions(-) (limited to 'src/modules') diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c index 6937d4dc8..d02ddd224 100644 --- a/src/modules/cs_enforce.c +++ b/src/modules/cs_enforce.c @@ -118,12 +118,9 @@ class CommandCSEnforce : public Command u = user->user; if (check_access(u, c->ci, CA_NOJOIN)) { - av[0] = "+b"; get_idealban(ci, u, mask, sizeof(mask)); - av[1] = mask; reason = getstring(u, CHAN_NOT_ALLOWED_TO_JOIN); - ircdproto->SendMode(whosends(ci), ci->name, "+b %s %lu", mask, time(NULL)); - chan_set_modes(Config.s_ChanServ, c, 2, av, 1); + c->SetMode(NULL, CMODE_BAN, mask); ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason); av[0] = ci->name; av[1] = u->nick; @@ -159,14 +156,11 @@ class CommandCSEnforce : public Command u = user->user; if (!nick_identified(u)) { - av[0] = "+b"; get_idealban(ci, u, mask, sizeof(mask)); - av[1] = mask; reason = getstring(u, CHAN_NOT_ALLOWED_TO_JOIN); if (!c->HasMode(CMODE_REGISTERED)) { - ircdproto->SendMode(whosends(ci), ci->name, "+b %s %lu", mask, time(NULL)); - chan_set_modes(Config.s_ChanServ, c, 2, av, 1); + c->SetMode(NULL, CMODE_BAN, mask); } ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason); av[0] = ci->name; diff --git a/src/modules/cs_tban.c b/src/modules/cs_tban.c index 7da2a90ed..7f84f3e85 100644 --- a/src/modules/cs_tban.c +++ b/src/modules/cs_tban.c @@ -179,33 +179,18 @@ class TempBan : public Timer void Tick(time_t ctime) { - const char *av[3]; Channel *c; - av[0] = "-b"; - av[1] = mask.c_str(); - if ((c = findchan(chan.c_str())) && c->ci) { - ircdproto->SendMode(whosends(c->ci), c->name, "-b %s", av[1]); - chan_set_modes(Config.s_ChanServ, c, 2, av, 1); + c->RemoveMode(NULL, CMODE_BAN, mask); } } }; void addBan(Channel *c, time_t timeout, char *banmask) { - const char *av[3]; - char *cb[2]; - - cb[0] = c->name; - cb[1] = banmask; - - av[0] = "+b"; - av[1] = banmask; - - ircdproto->SendMode(whosends(c->ci), c->name, "+b %s", av[1]); - chan_set_modes(Config.s_ChanServ, c, 2, av, 1); + c->SetMode(NULL, CMODE_BAN, banmask); me->AddCallBack(new TempBan(timeout, c->name, banmask)); } -- cgit