diff options
-rw-r--r-- | include/protocol.h | 2 | ||||
-rw-r--r-- | modules/m_sasl.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/inspircd.cpp | 21 | ||||
-rw-r--r-- | modules/protocol/plexus.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/solanum.cpp | 5 | ||||
-rw-r--r-- | modules/protocol/unrealircd.cpp | 4 |
6 files changed, 17 insertions, 21 deletions
diff --git a/include/protocol.h b/include/protocol.h index 171c9e77b..55fdc0b69 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -223,7 +223,7 @@ class CoreExport IRCDProto : public Service virtual void SendSASLMechanisms(std::vector<Anope::string> &) { } virtual void SendSASLMessage(const SASL::Message &) { } - virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) { } + virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) { } virtual bool IsNickValid(const Anope::string &); virtual bool IsChannelValid(const Anope::string &); diff --git a/modules/m_sasl.cpp b/modules/m_sasl.cpp index 7a803469e..a838a1aca 100644 --- a/modules/m_sasl.cpp +++ b/modules/m_sasl.cpp @@ -261,7 +261,7 @@ class SASLService : public SASL::Service, public Timer } else { - IRCD->SendSVSLogin(session->uid, nc->display, na->GetVhostIdent(), na->GetVhostHost()); + IRCD->SendSVSLogin(session->uid, na); } this->SendMessage(session, "D", "S"); } diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 1acc3cfd2..94edf1737 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -433,24 +433,19 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "ENCAP " << message.target.substr(0, 3) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override + void SendSVSLogin(const Anope::string &uid, NickAlias *na) 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; + UplinkSocket::Message(Me) << "METADATA " << uid << " accountid :" << na->nc->GetId(); + UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << na->nc->display; - if (!vident.empty()) - UplinkSocket::Message(Me) << "ENCAP " << uid.substr(0, 3) << " CHGIDENT " << uid << " " << vident; - if (!vhost.empty()) - UplinkSocket::Message(Me) << "ENCAP " << uid.substr(0, 3) << " CHGHOST " << uid << " " << vhost; + if (!na->GetVhostIdent().empty()) + UplinkSocket::Message(Me) << "ENCAP " << uid.substr(0, 3) << " CHGIDENT " << uid << " " << na->GetVhostIdent(); + if (!na->GetVhostHost().empty()) + UplinkSocket::Message(Me) << "ENCAP " << uid.substr(0, 3) << " CHGHOST " << uid << " " << na->GetVhostHost(); SASLUser su; su.uid = uid; - su.acc = acc; + su.acc = na->nc->display; su.created = Anope::CurTime; for (std::list<SASLUser>::iterator it = saslusers.begin(); it != saslusers.end();) diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 352d860ca..5fd52fda3 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -174,11 +174,11 @@ class PlexusProto : public IRCDProto UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : message.target.substr(0, 3)) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override + void SendSVSLogin(const Anope::string &uid, NickAlias *na) anope_override { Server *s = Server::Find(uid.substr(0, 3)); UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * * " - << (vhost.empty() ? "*" : vhost) << " " << acc; + << (na->GetVhostHost().empty() ? "*" : na->GetVhostHost()) << " " << na->nc->display; } void SendSVSNOOP(const Server *server, bool set) anope_override diff --git a/modules/protocol/solanum.cpp b/modules/protocol/solanum.cpp index 787223059..3017c86a6 100644 --- a/modules/protocol/solanum.cpp +++ b/modules/protocol/solanum.cpp @@ -158,10 +158,11 @@ class SolanumProto : public IRCDProto UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : message.target.substr(0, 3)) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override + void SendSVSLogin(const Anope::string &uid, NickAlias *na) anope_override { Server *s = Server::Find(uid.substr(0, 3)); - UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * " << (!vident.empty() ? vident : '*') << " " << (!vhost.empty() ? vhost : '*') << " " << acc; + UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * " << (!na->GetVhostIdent().empty() ? na->GetVhostIdent() : '*') + << " " << (!na->GetVhostHost().empty() ? na->GetVhostHost() : '*') << " " << na->nc->display; } }; diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp index e19628b2f..c3a3b5769 100644 --- a/modules/protocol/unrealircd.cpp +++ b/modules/protocol/unrealircd.cpp @@ -390,7 +390,7 @@ class UnrealIRCdProto : public IRCDProto UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << distmask << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override + void SendSVSLogin(const Anope::string &uid, NickAlias *na) anope_override { size_t p = uid.find('!'); Anope::string distmask; @@ -406,7 +406,7 @@ class UnrealIRCdProto : public IRCDProto { distmask = uid.substr(0, p); } - UplinkSocket::Message(Me) << "SVSLOGIN " << distmask << " " << uid << " " << acc; + UplinkSocket::Message(Me) << "SVSLOGIN " << distmask << " " << uid << " " << na->nc->display; } bool IsIdentValid(const Anope::string &ident) anope_override |