summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-02-27 16:47:23 -0500
committerAdam <Adam@anope.org>2011-02-27 16:47:23 -0500
commitbcaf406747ea0456e97f40ba09f76223dd246581 (patch)
tree441f91fc002fda94a2008d9e7a755c76c30cd2c0 /modules
parentf234a2bfab8a4d900cfc0df91afed530d80738d4 (diff)
Made akills work on IRCds that do not support bans (ngircd)
Diffstat (limited to 'modules')
-rw-r--r--modules/core/bs_bot.cpp4
-rw-r--r--modules/core/cs_forbid.cpp2
-rw-r--r--modules/core/ns_forbid.cpp2
-rw-r--r--modules/extra/cs_set_misc.cpp1
-rw-r--r--modules/extra/m_dnsbl.cpp4
-rw-r--r--modules/protocol/bahamut.cpp8
-rw-r--r--modules/protocol/inspircd-ts6.h6
-rw-r--r--modules/protocol/inspircd11.cpp6
-rw-r--r--modules/protocol/ngircd.cpp15
-rw-r--r--modules/protocol/plexus.cpp6
-rw-r--r--modules/protocol/ratbox.cpp6
-rw-r--r--modules/protocol/unreal32.cpp8
12 files changed, 35 insertions, 33 deletions
diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp
index 0c0c0730d..38ddc738e 100644
--- a/modules/core/bs_bot.cpp
+++ b/modules/core/bs_bot.cpp
@@ -241,7 +241,7 @@ class CommandBSBot : public Command
{
ircdproto->SendChangeBotNick(bi, nick);
XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
}
if (!nick.equals_cs(bi->nick))
@@ -258,7 +258,7 @@ class CommandBSBot : public Command
{
ircdproto->SendClientIntroduction(bi, ircd->pseudoclient_mode);
XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
bi->RejoinAll();
}
diff --git a/modules/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp
index 3d75b9233..f0cdbff86 100644
--- a/modules/core/cs_forbid.cpp
+++ b/modules/core/cs_forbid.cpp
@@ -82,7 +82,7 @@ class CommandCSForbid : public Command
if (ircd->chansqline)
{
XLine x(chan, "Forbidden");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
}
Log(LOG_ADMIN, u, this, ci) << (!ci->forbidreason.empty() ? ci->forbidreason : "No reason");
diff --git a/modules/core/ns_forbid.cpp b/modules/core/ns_forbid.cpp
index a9d3bd09b..0ced5ec68 100644
--- a/modules/core/ns_forbid.cpp
+++ b/modules/core/ns_forbid.cpp
@@ -71,7 +71,7 @@ class CommandNSForbid : public Command
if (ircd->sqline)
{
XLine x(na->nick, !reason.empty() ? reason : "Forbidden");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
}
Log(LOG_ADMIN, u, this) << "to forbid nick " << nick;
diff --git a/modules/extra/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp
index 1ed2e3c64..cb654a9a1 100644
--- a/modules/extra/cs_set_misc.cpp
+++ b/modules/extra/cs_set_misc.cpp
@@ -23,7 +23,6 @@ class CommandCSSetMisc : public Command
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
- User *u = source.u;
ChannelInfo *ci = source.ci;
if (!ci)
throw CoreException("NULL ci in CommandCSSetMisc");
diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp
index b3f45ceb4..5c88e75b5 100644
--- a/modules/extra/m_dnsbl.cpp
+++ b/modules/extra/m_dnsbl.cpp
@@ -66,13 +66,13 @@ class DNSBLResolver : public DNSRequest
Log(LOG_COMMAND, OperServ, &fake_akill) << "for " << user->GetMask() << " (Listed in " << this->blacklist.name << ")";
/* If AkillOnAdd is disabled send it anyway, noone wants bots around... */
if (!Config->AkillOnAdd)
- ircdproto->SendAkill(x);
+ ircdproto->SendAkill(*user, x);
}
else
{
Log(OperServ) << "DNSBL: " << user->GetMask() << " appears in " << this->blacklist.name;
XLine xline(Anope::string("*@") + user->host, OperServ ? OperServ->nick : "OperServ", Anope::CurTime + this->blacklist.bantime, reason);
- ircdproto->SendAkill(&xline);
+ ircdproto->SendAkill(*user, &xline);
}
}
};
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 5da7c4785..be782fe18 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -99,7 +99,7 @@ class BahamutIRCdProto : public IRCDProto
}
/* SQLINE */
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd("", "SQLINE %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
@@ -120,7 +120,7 @@ class BahamutIRCdProto : public IRCDProto
}
/* SZLINE */
- void SendSZLine(const XLine *x)
+ void SendSZLine(User *, const XLine *x)
{
/* this will likely fail so its only here for legacy */
send_cmd("", "SZLINE %s :%s", x->Mask.c_str(), x->Reason.c_str());
@@ -135,7 +135,7 @@ class BahamutIRCdProto : public IRCDProto
}
/* SGLINE */
- void SendSGLine(const XLine *x)
+ void SendSGLine(User *, const XLine *x)
{
send_cmd("", "SGLINE %d :%s:%s", static_cast<int>(x->Mask.length()), x->Mask.c_str(), x->Reason.c_str());
}
@@ -168,7 +168,7 @@ class BahamutIRCdProto : public IRCDProto
c->SetMode(user, static_cast<ChannelModeName>(i), user->nick, false);
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h
index 3642a75f4..427233738 100644
--- a/modules/protocol/inspircd-ts6.h
+++ b/modules/protocol/inspircd-ts6.h
@@ -51,7 +51,7 @@ class InspIRCdTS6Proto : public IRCDProto
this->SendChgIdentInternal(u->nick, u->GetIdent());
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
@@ -125,7 +125,7 @@ class InspIRCdTS6Proto : public IRCDProto
}
/* SQLINE */
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd(Config->Numeric, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config->s_OperServ.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
}
@@ -172,7 +172,7 @@ class InspIRCdTS6Proto : public IRCDProto
}
/* SZLINE */
- void SendSZLine(const XLine *x)
+ void SendSZLine(User *, const XLine *x)
{
send_cmd(Config->Numeric, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
}
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index a8868817c..0689b8605 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -99,7 +99,7 @@ class InspIRCdProto : public IRCDProto
inspircd_cmd_chgident(u->nick, u->GetIdent());
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
@@ -170,7 +170,7 @@ class InspIRCdProto : public IRCDProto
}
/* SQLINE */
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd(Config->ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config->s_OperServ.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
}
@@ -231,7 +231,7 @@ class InspIRCdProto : public IRCDProto
}
/* SZLINE */
- void SendSZLine(const XLine *x)
+ void SendSZLine(User *, const XLine *x)
{
send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
}
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
index 85383dbf2..f72624419 100644
--- a/modules/protocol/ngircd.cpp
+++ b/modules/protocol/ngircd.cpp
@@ -18,7 +18,7 @@ IRCDVar myIrcd[] = {
0, /* SVSNICK */
0, /* Vhost */
0, /* Supports SNlines */
- 1, /* Supports SQlines */
+ 0, /* Supports SQlines */
0, /* Supports SZlines */
0, /* Join 2 Message */
0, /* Chan SQlines */
@@ -42,12 +42,15 @@ IRCDVar myIrcd[] = {
/* PASS */
class ngIRCdProto : public IRCDProto
{
- void SendAkill(const XLine *x) { }
+ void SendAkill(User *u, const XLine *x)
+ {
+ if (SGLine && u == NULL)
+ for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();)
+ if (SGLine->Check(*it) != NULL)
+ break;
+ }
+
void SendAkillDel(const XLine*) { }
- void SendSQLine(const XLine*) { }
- void SendSQLineDel(const XLine*) { }
- void SendSGLine(const XLine *x) { }
- void SendSGLineDel(const XLine *x) { }
void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
{
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 98ca554e9..9d360312e 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -92,7 +92,7 @@ class PlexusProto : public IRCDProto
send_cmd(source ? source->GetUID() : Config->Numeric, "OPERWALL :%s", buf.c_str());
}
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd(Config->Numeric, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
@@ -103,7 +103,7 @@ class PlexusProto : public IRCDProto
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "UNXLINE * %s", x->Mask.c_str());
}
- void SendSGLine(const XLine *x)
+ void SendSGLine(User *, const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "XLINE * %s 0 :%s", x->Mask.c_str(), x->Reason.c_str());
@@ -129,7 +129,7 @@ class PlexusProto : public IRCDProto
c->SetMode(user, static_cast<ChannelModeName>(i), user->nick, false);
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(x->Expires - Anope::CurTime), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str());
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index 1eaafc144..844889310 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -95,7 +95,7 @@ class RatboxProto : public IRCDProto
send_cmd(source ? source->GetUID() : Config->Numeric, "OPERWALL :%s", buf.c_str());
}
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd(Config->Numeric, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
@@ -106,7 +106,7 @@ class RatboxProto : public IRCDProto
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "UNXLINE * %s", x->Mask.c_str());
}
- void SendSGLine(const XLine *x)
+ void SendSGLine(User *, const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "XLINE * %s 0 :%s", x->Mask.c_str(), x->Reason.c_str());
@@ -139,7 +139,7 @@ class RatboxProto : public IRCDProto
}
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(x->Expires - Anope::CurTime), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str());
diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp
index d5ee0ef2a..89940ab42 100644
--- a/modules/protocol/unreal32.cpp
+++ b/modules/protocol/unreal32.cpp
@@ -113,7 +113,7 @@ class UnrealIRCdProto : public IRCDProto
ModeManager::ProcessModes();
}
- void SendAkill(const XLine *x)
+ void SendAkill(User *, const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
@@ -190,7 +190,7 @@ class UnrealIRCdProto : public IRCDProto
** - Unreal will translate this to TKL for us
**
*/
- void SendSQLine(const XLine *x)
+ void SendSQLine(User *, const XLine *x)
{
send_cmd("", "c %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
@@ -257,7 +257,7 @@ class UnrealIRCdProto : public IRCDProto
}
/* SZLINE */
- void SendSZLine(const XLine *x)
+ void SendSZLine(User *, const XLine *x)
{
send_cmd("", "BD + Z * %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime + 172800), static_cast<long>(Anope::CurTime), x->Reason.c_str());
}
@@ -266,7 +266,7 @@ class UnrealIRCdProto : public IRCDProto
/*
* SVSNLINE + reason_where_is_space :realname mask with spaces
*/
- void SendSGLine(const XLine *x)
+ void SendSGLine(User *, const XLine *x)
{
Anope::string edited_reason = x->Reason;
edited_reason = edited_reason.replace_all_cs(" ", "_");