diff options
author | Zoddo <zoddo.ino@gmail.com> | 2016-10-02 13:56:37 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-10-02 13:56:37 -0400 |
commit | ee7af884c7909c30839d7b6ceb47abdbdde4ed97 (patch) | |
tree | 6b300b9a6bb471286b63f3ed4b1e33d8cb1255b1 | |
parent | 33ef08b8a0fb910fa7fd99584dbae88630738a3e (diff) |
Send vident/vhost in SVSLOGIN with SASL
-rw-r--r-- | include/protocol.h | 2 | ||||
-rw-r--r-- | modules/protocol/charybdis.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/unreal.cpp | 2 | ||||
-rw-r--r-- | modules/sasl.cpp | 5 |
5 files changed, 8 insertions, 7 deletions
diff --git a/include/protocol.h b/include/protocol.h index de83cd203..4fdc97f0c 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -247,7 +247,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) { } + virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) { } virtual bool IsNickValid(const Anope::string &); virtual bool IsChannelValid(const Anope::string &); diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index ccc36b48d..1f3cb801d 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -173,10 +173,10 @@ class CharybdisProto : public IRCDProto Uplink::Send(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) override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override { Server *s = Server::Find(uid.substr(0, 3)); - Uplink::Send(Me, "ENCAP", s ? s->GetName() : uid.substr(0, 3), "SVSLOGIN", uid, "*", "*", "*", acc); + Uplink::Send(Me, "ENCAP", s ? s->GetName() : uid.substr(0, 3), "SVSLOGIN", uid, "*", vident.empty() ? "*" : vident, vhost.empty() ? "*" : vhost, acc); } }; diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index f4dfcb12f..f8bf9b30e 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -422,7 +422,7 @@ class InspIRCd20Proto : public IRCDProto message.type, message.data); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override { Uplink::Send(Me, "METADATA", uid, "accountname", acc); diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index fe5ddad2d..d805e60cb 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -394,7 +394,7 @@ class UnrealIRCdProto : public IRCDProto Uplink::Send(ServiceBot::Find(message.source), "SASL", message.target.substr(0, p), message.target, message.type, message.data); } - void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) override + void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override { size_t p = uid.find('!'); if (p == Anope::string::npos) diff --git a/modules/sasl.cpp b/modules/sasl.cpp index 42d3bd9f3..f07026b9e 100644 --- a/modules/sasl.cpp +++ b/modules/sasl.cpp @@ -238,13 +238,14 @@ class SASLService : public SASL::Service, public Timer // If the user is already introduced then we log them in now. // Otherwise, we send an SVSLOGIN to log them in later. User *user = User::Find(session->uid); + NickServ::Nick *na = NickServ::FindNick(nc->GetDisplay()); if (user) { - user->Login(nc); + user->Identify(na); } else { - IRCD->SendSVSLogin(session->uid, nc->GetDisplay()); + IRCD->SendSVSLogin(session->uid, nc->GetDisplay(), na->GetVhostIdent(), na->GetVhostHost()); } this->SendMessage(session, "D", "S"); } |