diff options
author | Sadie Powell <sadie@witchery.services> | 2021-02-18 23:59:28 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-02-18 23:59:28 +0000 |
commit | c68b81eac87314fb0da83a83fed8679e521cf8eb (patch) | |
tree | 1200203b739e52f652a9ba1170e4813270780edb /modules/protocol/inspircd.cpp | |
parent | 8b2c1548ab46401f96d4e2e0f8258664e21744fb (diff) | |
parent | 4d271e021042f0b2708abaff5ff3cfb1504a5cc0 (diff) |
Merge branch '2.0' into 2.1.
Diffstat (limited to 'modules/protocol/inspircd.cpp')
-rw-r--r-- | modules/protocol/inspircd.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index e597ce958..1acc3cfd2 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -1,6 +1,6 @@ /* InspIRCd functions * - * (C) 2003-2020 Anope Team + * (C) 2003-2021 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. @@ -62,6 +62,7 @@ class InspIRCdProto : public IRCDProto CanSetVHost = true; CanSetVIdent = true; CanSQLine = true; + CanSQLineChannel = true; CanSZLine = true; CanSVSHold = true; CanCertFP = true; @@ -313,7 +314,10 @@ class InspIRCdProto : 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 InspIRCdProto : 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 @@ -405,14 +413,14 @@ class InspIRCdProto : public IRCDProto if (na->nc->HasExt("UNCONFIRMED")) return; - UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountid :" << na->nc->GetId(); + UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; } void SendLogout(User *u) anope_override { - UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountid :"; + UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; } void SendChannel(Channel *c) anope_override @@ -427,6 +435,12 @@ class InspIRCdProto : public IRCDProto void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override { + // TODO: in 2.1 this function should take a NickAlias instead of strings. + NickCore *nc = NickCore::Find(acc); + if (!nc) + return; + + UplinkSocket::Message(Me) << "METADATA " << uid << " accountid :" << nc->GetId(); UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << acc; if (!vident.empty()) @@ -863,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"; } @@ -1099,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) |