diff options
| author | Adam <Adam@anope.org> | 2011-07-14 02:31:12 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-07-14 02:31:12 -0400 |
| commit | f858164deed48f2dcacd5ffc06a55398a54da7e8 (patch) | |
| tree | 89c3cf36bd8e94942370135218d67d6d17ee222e /modules/extra/m_dnsbl.cpp | |
| parent | 924f6849fee4598a1a3a7f1a98d96b79e5ffd3b4 (diff) | |
Rewrote how commands are handled within Anope.
This allows naming commands and having spaces within command names.
Diffstat (limited to 'modules/extra/m_dnsbl.cpp')
| -rw-r--r-- | modules/extra/m_dnsbl.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp index 06d55df92..a860a10f0 100644 --- a/modules/extra/m_dnsbl.cpp +++ b/modules/extra/m_dnsbl.cpp @@ -6,13 +6,8 @@ */ #include "module.h" -#include "operserv.h" -struct FakeAkill : public Command -{ - FakeAkill() : Command("AKILL", 0, 0) { this->service = findbot(Config->s_OperServ); } - CommandReturn Execute(CommandSource &, const std::vector<Anope::string> &) { return MOD_CONT; } -} fake_akill; +static service_reference<XLineManager> akills("xlinemanager/sgline"); struct Blacklist { @@ -62,17 +57,18 @@ class DNSBLResolver : public DNSRequest reason = reason.replace_all_cs("%N", Config->NetworkName); XLine *x = NULL; - if (this->add_to_akill && SGLine && (x = SGLine->Add(Anope::string("*@") + user->host, Config->s_OperServ, Anope::CurTime + this->blacklist.bantime, reason))) + BotInfo *operserv = findbot(Config->OperServ); + if (this->add_to_akill && akills && (x = akills->Add(Anope::string("*@") + user->host, Config->OperServ, Anope::CurTime + this->blacklist.bantime, reason))) { - Log(LOG_COMMAND, operserv->Bot(), &fake_akill) << "for " << user->GetMask() << " (Listed in " << this->blacklist.name << ")"; + Log(operserv) << "DNSBL: " << user->GetMask() << " appears in " << this->blacklist.name; /* If AkillOnAdd is disabled send it anyway, noone wants bots around... */ if (!Config->AkillOnAdd) ircdproto->SendAkill(user, x); } else { - Log(operserv->Bot()) << "DNSBL: " << user->GetMask() << " appears in " << this->blacklist.name; - XLine xline(Anope::string("*@") + user->host, Config->s_OperServ, Anope::CurTime + this->blacklist.bantime, reason); + Log(operserv) << "DNSBL: " << user->GetMask() << " appears in " << this->blacklist.name << "(" << reason << ")"; + XLine xline(Anope::string("*@") + user->host, Config->OperServ, Anope::CurTime + this->blacklist.bantime, reason); ircdproto->SendAkill(user, &xline); } } |
