summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/cs_enforce.c10
-rw-r--r--src/modules/cs_tban.c19
2 files changed, 4 insertions, 25 deletions
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));
}