summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/operserv.h16
-rw-r--r--include/services.h10
-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
-rw-r--r--src/bots.cpp2
-rw-r--r--src/init.cpp7
-rw-r--r--src/operserv.cpp68
17 files changed, 87 insertions, 84 deletions
diff --git a/include/operserv.h b/include/operserv.h
index f40815a45..f039b6107 100644
--- a/include/operserv.h
+++ b/include/operserv.h
@@ -97,10 +97,6 @@ class CoreExport XLineManager
*/
static std::pair<XLineManager *, XLine *> CheckAll(User *u);
- /** Called on burst when all of our XLines should be bursted to the uplink
- */
- static void Burst();
-
/** Get the number of XLines in this XLineManager
* @return The number of XLines
*/
@@ -184,8 +180,10 @@ class CoreExport XLineManager
virtual void OnExpire(XLine *x);
/** Called to send an XLine to the IRCd
+ * @param u The user, if we know it
+ * @param x The xline
*/
- virtual void Send(XLine *x) = 0;
+ virtual void Send(User *u, XLine *x) = 0;
};
/* This is for AKILLS */
@@ -200,7 +198,7 @@ class SGLineManager : public XLineManager
void OnExpire(XLine *x);
- void Send(XLine *x);
+ void Send(User *u, XLine *x);
};
class SNLineManager : public XLineManager
@@ -214,7 +212,7 @@ class SNLineManager : public XLineManager
void OnExpire(XLine *x);
- void Send(XLine *x);
+ void Send(User *u, XLine *x);
XLine *Check(User *u);
};
@@ -230,7 +228,7 @@ class SQLineManager : public XLineManager
void OnExpire(XLine *x);
- void Send(XLine *x);
+ void Send(User *u, XLine *x);
static bool Check(Channel *c);
};
@@ -246,7 +244,7 @@ class SZLineManager : public XLineManager
void OnExpire(XLine *x);
- void Send(XLine *x);
+ void Send(User *u, XLine *x);
};
#endif // OPERSERV_H
diff --git a/include/services.h b/include/services.h
index 646dbfbfe..58c512d0b 100644
--- a/include/services.h
+++ b/include/services.h
@@ -973,7 +973,7 @@ class CoreExport IRCDProto
virtual void SendSVSNOOP(const Anope::string &, int) { }
virtual void SendTopic(BotInfo *, Channel *) = 0;
virtual void SendVhostDel(User *) { }
- virtual void SendAkill(const XLine *) = 0;
+ virtual void SendAkill(User *, const XLine *) = 0;
virtual void SendAkillDel(const XLine *) = 0;
virtual void SendSVSKill(const BotInfo *source, const User *user, const char *fmt, ...);
virtual void SendMode(const BotInfo *bi, const Channel *dest, const char *fmt, ...);
@@ -992,11 +992,11 @@ class CoreExport IRCDProto
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
virtual void SendJoin(BotInfo *, Channel *, const ChannelStatus *) = 0;
- virtual void SendSQLineDel(const XLine *x) = 0;
+ virtual void SendSQLineDel(const XLine *x) { }
virtual void SendInvite(const BotInfo *bi, const Anope::string &chan, const Anope::string &nick);
virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...);
virtual void SendGlobops(const BotInfo *source, const char *fmt, ...);
- virtual void SendSQLine(const XLine *x) = 0;
+ virtual void SendSQLine(User *, const XLine *x) { }
virtual void SendSquit(const Anope::string &servname, const Anope::string &message);
virtual void SendSVSO(const Anope::string &, const Anope::string &, const Anope::string &) { }
virtual void SendChangeBotNick(const BotInfo *bi, const Anope::string &newnick);
@@ -1007,8 +1007,8 @@ class CoreExport IRCDProto
virtual void SendSVSHoldDel(const Anope::string &) { }
virtual void SendSGLineDel(const XLine *) { }
virtual void SendSZLineDel(const XLine *) { }
- virtual void SendSZLine(const XLine *) { }
- virtual void SendSGLine(const XLine *) { }
+ virtual void SendSZLine(User *u, const XLine *) { }
+ virtual void SendSGLine(User *, const XLine *) { }
virtual void SendUnregisteredNick(const User *) { }
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
virtual void SendSVSJoin(const Anope::string &, const Anope::string &, const Anope::string &, const Anope::string &) { }
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(" ", "_");
diff --git a/src/bots.cpp b/src/bots.cpp
index b77031c00..7e895a4be 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -55,7 +55,7 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
{
ircdproto->SendClientIntroduction(this, ircd->pseudoclient_mode);
XLine x(this->nick, "Reserved for services");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
}
this->SetModeInternal(ModeManager::FindUserModeByName(UMODE_PROTECTED));
diff --git a/src/init.cpp b/src/init.cpp
index fd2a1f3b1..7b520808b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -34,7 +34,7 @@ void introduce_user(const Anope::string &user)
if (bi)
{
XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
for (UChannelList::const_iterator cit = bi->chans.begin(), cit_end = bi->chans.end(); cit != cit_end; ++cit)
ircdproto->SendJoin(bi, (*cit)->chan, &Config->BotModeList);
@@ -67,7 +67,7 @@ void introduce_user(const Anope::string &user)
if (bi)
{
XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(&x);
+ ircdproto->SendSQLine(NULL, &x);
for (UChannelList::const_iterator cit = bi->chans.begin(), cit_end = bi->chans.end(); cit != cit_end; ++cit)
ircdproto->SendJoin(bi, (*cit)->chan, &Config->BotModeList);
@@ -77,9 +77,6 @@ void introduce_user(const Anope::string &user)
/* Load MLock from the database now that we know what modes exist */
for (registered_channel_map::iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
it->second->LoadMLock();
-
- /* Add our SXLines */
- XLineManager::Burst();
}
/*************************************************************************/
diff --git a/src/operserv.cpp b/src/operserv.cpp
index 5329988c2..a00e086fd 100644
--- a/src/operserv.cpp
+++ b/src/operserv.cpp
@@ -252,17 +252,6 @@ std::pair<XLineManager *, XLine *> XLineManager::CheckAll(User *u)
return ret;
}
-void XLineManager::Burst()
-{
- for (std::list<XLineManager *>::iterator it = XLineManagers.begin(), it_end = XLineManagers.end(); it != it_end; ++it)
- {
- XLineManager *xlm = *it;
-
- for (std::vector<XLine *>::const_iterator it2 = xlm->GetList().begin(), it2_end = xlm->GetList().end(); it2 != it2_end; ++it2)
- xlm->Send(*it2);
- }
-}
-
/** Get the number of XLines in this XLineManager
* @return The number of XLines
*/
@@ -446,7 +435,10 @@ XLine *XLineManager::Check(User *u)
{
cidr cidr_ip(x->GetHost());
if (cidr_ip.match(u->ip))
+ {
+ OnMatch(u, x);
return x;
+ }
}
catch (const SocketException &) { }
}
@@ -532,7 +524,7 @@ XLine *SGLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
this->AddXLine(x);
if (UplinkSock && Config->AkillOnAdd)
- this->Send(x);
+ this->Send(NULL, x);
return x;
}
@@ -544,7 +536,9 @@ void SGLineManager::Del(XLine *x)
void SGLineManager::OnMatch(User *u, XLine *x)
{
- ircdproto->SendAkill(x);
+ if (u)
+ kill_user(Config->s_OperServ, u, x->Reason);
+ ircdproto->SendAkill(u, x);
}
void SGLineManager::OnExpire(XLine *x)
@@ -553,9 +547,9 @@ void SGLineManager::OnExpire(XLine *x)
ircdproto->SendGlobops(OperServ, "AKILL on %s has expired", x->Mask.c_str());
}
-void SGLineManager::Send(XLine *x)
+void SGLineManager::Send(User *u, XLine *x)
{
- ircdproto->SendAkill(x);
+ ircdproto->SendAkill(u, x);
}
XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason)
@@ -620,9 +614,12 @@ void SNLineManager::Del(XLine *x)
void SNLineManager::OnMatch(User *u, XLine *x)
{
- this->Send(x);
- Anope::string reason = "G-Lined: " + x->Reason;
- kill_user(Config->s_OperServ, u, reason);
+ if (u)
+ {
+ Anope::string reason = "G-Lined: " + x->Reason;
+ kill_user(Config->s_OperServ, u, reason);
+ }
+ this->Send(u, x);
}
void SNLineManager::OnExpire(XLine *x)
@@ -631,9 +628,9 @@ void SNLineManager::OnExpire(XLine *x)
ircdproto->SendGlobops(OperServ, "SNLINE on \2%s\2 has expired", x->Mask.c_str());
}
-void SNLineManager::Send(XLine *x)
+void SNLineManager::Send(User *u, XLine *x)
{
- ircdproto->SendSGLine(x);
+ ircdproto->SendSGLine(u, x);
}
XLine *SNLineManager::Check(User *u)
@@ -743,7 +740,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
}
if (UplinkSock)
- this->Send(x);
+ this->Send(NULL, x);
return x;
}
@@ -755,10 +752,13 @@ void SQLineManager::Del(XLine *x)
void SQLineManager::OnMatch(User *u, XLine *x)
{
- ircdproto->SendSQLine(x);
+ if (u)
+ {
+ Anope::string reason = "Q-Lined: " + x->Reason;
+ kill_user(Config->s_OperServ, u, reason);
+ }
- Anope::string reason = "Q-Lined: " + x->Reason;
- kill_user(Config->s_OperServ, u, reason);
+ ircdproto->SendSQLine(u, x);
}
void SQLineManager::OnExpire(XLine *x)
@@ -767,16 +767,16 @@ void SQLineManager::OnExpire(XLine *x)
ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", x->Mask.c_str());
}
-void SQLineManager::Send(XLine *x)
+void SQLineManager::Send(User *u, XLine *x)
{
- ircdproto->SendSQLine(x);
+ ircdproto->SendSQLine(u, x);
}
bool SQLineManager::Check(Channel *c)
{
if (ircd->chansqline && SQLine)
{
- for (std::vector<XLine *>::const_iterator it = SGLine->GetList().begin(), it_end = SGLine->GetList().end(); it != it_end; ++it)
+ for (std::vector<XLine *>::const_iterator it = SQLine->GetList().begin(), it_end = SQLine->GetList().end(); it != it_end; ++it)
{
XLine *x = *it;
@@ -831,7 +831,7 @@ XLine *SZLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
this->AddXLine(x);
if (UplinkSock)
- this->Send(x);
+ this->Send(NULL, x);
return x;
}
@@ -843,7 +843,13 @@ void SZLineManager::Del(XLine *x)
void SZLineManager::OnMatch(User *u, XLine *x)
{
- ircdproto->SendSZLine(x);
+ if (u)
+ {
+ Anope::string reason = "Z-Lined: " + x->Reason;
+ kill_user(Config->s_OperServ, u, reason);
+ }
+
+ ircdproto->SendSZLine(u, x);
}
void SZLineManager::OnExpire(XLine *x)
@@ -852,8 +858,8 @@ void SZLineManager::OnExpire(XLine *x)
ircdproto->SendGlobops(OperServ, "SZLINE on \2%s\2 has expired", x->Mask.c_str());
}
-void SZLineManager::Send(XLine *x)
+void SZLineManager::Send(User *u, XLine *x)
{
- ircdproto->SendSZLine(x);
+ ircdproto->SendSZLine(u, x);
}