summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hazell <michaelhazell@hotmail.com>2021-01-01 14:03:23 -0500
committerGitHub <noreply@github.com>2021-01-01 19:03:23 +0000
commit4031dc73211217b5bab6504bbcf3e60c0c36d8e3 (patch)
treef3424b29533e2efcc3355c0ccaed7597d53a81cd
parentd1e49438001d0f1ee46797280c3da0f4e59d8874 (diff)
inspircd3: Enable support for channel SQLines (#268)
-rw-r--r--modules/protocol/inspircd3.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/protocol/inspircd3.cpp b/modules/protocol/inspircd3.cpp
index c7582f723..164785de6 100644
--- a/modules/protocol/inspircd3.cpp
+++ b/modules/protocol/inspircd3.cpp
@@ -62,6 +62,7 @@ class InspIRCd3Proto : public IRCDProto
CanSetVHost = true;
CanSetVIdent = true;
CanSQLine = true;
+ CanSQLineChannel = true;
CanSZLine = true;
CanSVSHold = true;
CanCertFP = true;
@@ -313,7 +314,10 @@ class InspIRCd3Proto : public IRCDProto
void SendSQLineDel(const XLine *x) anope_override
{
- SendDelLine("Q", x->mask);
+ if (IRCD->CanSQLineChannel && (x->mask[0] == '#'))
+ SendDelLine("CBAN", x->mask);
+ else
+ SendDelLine("Q", x->mask);
}
void SendSQLine(User *u, const XLine *x) anope_override
@@ -322,7 +326,11 @@ class InspIRCd3Proto : public IRCDProto
time_t timeleft = x->expires - Anope::CurTime;
if (timeleft > 172800 || !x->expires)
timeleft = 172800;
- SendAddLine("Q", x->mask, timeleft, x->by, x->GetReason());
+
+ if (IRCD->CanSQLineChannel && (x->mask[0] == '#'))
+ SendAddLine("CBAN", x->mask, timeleft, x->by, x->GetReason());
+ else
+ SendAddLine("Q", x->mask, timeleft, x->by, x->GetReason());
}
void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override
@@ -869,6 +877,7 @@ struct IRCDMessageCapab : Message::Capab
/* reset CAPAB */
Servers::Capab.insert("SERVERS");
Servers::Capab.insert("TOPICLOCK");
+ IRCD->CanSQLineChannel = false;
IRCD->CanSVSHold = false;
IRCD->DefaultPseudoclientModes = "+I";
}
@@ -1105,6 +1114,8 @@ struct IRCDMessageCapab : Message::Capab
}
else if (module.equals_cs("m_topiclock.so"))
Servers::Capab.insert("TOPICLOCK");
+ else if (module.equals_cs("m_cban.so=glob"))
+ IRCD->CanSQLineChannel = true;
}
}
else if (params[0].equals_cs("MODSUPPORT") && params.size() > 1)