mirror of
https://github.com/anope/anope.git
synced 2026-07-10 18:23:13 +02:00
Merge pull request #161 from Zoddo/charybdis/vhost_svslogin
Send vident/vhost in SVSLOGIN with SASL
This commit is contained in:
+1
-1
@@ -229,7 +229,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 &);
|
||||
|
||||
+2
-1
@@ -226,13 +226,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);
|
||||
const NickAlias *na = NickAlias::Find(nc->display);
|
||||
if (user)
|
||||
{
|
||||
user->Login(nc);
|
||||
}
|
||||
else
|
||||
{
|
||||
IRCD->SendSVSLogin(session->uid, nc->display);
|
||||
IRCD->SendSVSLogin(session->uid, nc->display, na->GetVhostIdent(), na->GetVhostHost());
|
||||
}
|
||||
this->SendMessage(session, "D", "S");
|
||||
}
|
||||
|
||||
@@ -159,10 +159,10 @@ class CharybdisProto : 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) anope_override
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
|
||||
{
|
||||
Server *s = Server::Find(uid.substr(0, 3));
|
||||
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * * * " << acc;
|
||||
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * " << (!vident.empty() ? vident : '*') << " " << (!vhost.empty() ? vhost : '*') << " " << acc;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ class InspIRCd12Proto : 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) anope_override
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
|
||||
{
|
||||
UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << acc;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class InspIRCd20Proto : public IRCDProto
|
||||
void SendLogout(User *u) anope_override { insp12->SendLogout(u); }
|
||||
void SendChannel(Channel *c) anope_override { insp12->SendChannel(c); }
|
||||
void SendSASLMessage(const SASL::Message &message) anope_override { insp12->SendSASLMessage(message); }
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override { insp12->SendSVSLogin(uid, acc); }
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override { insp12->SendSVSLogin(uid, acc, vident, vhost); }
|
||||
bool IsExtbanValid(const Anope::string &mask) anope_override { return insp12->IsExtbanValid(mask); }
|
||||
bool IsIdentValid(const Anope::string &ident) anope_override { return insp12->IsIdentValid(ident); }
|
||||
};
|
||||
|
||||
@@ -386,7 +386,7 @@ class UnrealIRCdProto : public IRCDProto
|
||||
UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
|
||||
}
|
||||
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
|
||||
{
|
||||
size_t p = uid.find('!');
|
||||
if (p == Anope::string::npos)
|
||||
|
||||
@@ -374,7 +374,7 @@ class UnrealIRCdProto : public IRCDProto
|
||||
UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
|
||||
}
|
||||
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
|
||||
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
|
||||
{
|
||||
size_t p = uid.find('!');
|
||||
if (p == Anope::string::npos)
|
||||
|
||||
Reference in New Issue
Block a user