1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 07:46:36 +02:00

Switch SendSVSLogin to take a NickAlias.

This commit is contained in:
Sadie Powell
2021-04-27 17:31:14 +01:00
parent fd774bd52a
commit dfc8bd4aa2
6 changed files with 17 additions and 21 deletions
+1 -1
View File
@@ -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 &);
+1 -1
View File
@@ -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");
}
+8 -13
View File
@@ -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 :" << na->nc->GetId();
UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << na->nc->display;
UplinkSocket::Message(Me) << "METADATA " << uid << " accountid :" << nc->GetId();
UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << acc;
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();)
+2 -2
View File
@@ -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
+3 -2
View File
@@ -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;
}
};
+2 -2
View File
@@ -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