1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 15:46:39 +02:00

Add login support for ngIRCd

This is implemented via the accountname METADATA command
This commit is contained in:
Federico G. Schwindt
2013-08-22 14:33:17 +01:00
parent 8be5f53f1f
commit 243d781e99
+16 -3
View File
@@ -109,9 +109,15 @@ class ngIRCdProto : public IRCDProto
UplinkSocket::Message(source) << "KICK " << chan->name << " " << user->nick;
}
void SendLogin(User *u) anope_override { }
void SendLogin(User *u) anope_override
{
UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << u->Account()->display;
}
void SendLogout(User *u) anope_override { }
void SendLogout(User *u) anope_override
{
UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :";
}
void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
{
@@ -312,6 +318,7 @@ struct IRCDMessageMetadata : IRCDMessage
* params[3] = data
*
* following commands are supported:
* - "accountname": the account name of a client (can't be empty)
* - "host": the hostname of a client (can't be empty)
* - "cloakhost" : the cloaked hostname of a client
* - "info": info text ("real name") of a client
@@ -327,7 +334,13 @@ struct IRCDMessageMetadata : IRCDMessage
Log() << "received METADATA for non-existent user " << params[0];
return;
}
if (params[1].equals_cs("host"))
if (params[1].equals_cs("accountname"))
{
NickCore *nc = NickCore::Find(params[2]);
if (nc)
u->Login(nc);
}
else if (params[1].equals_cs("host"))
{
u->SetCloakedHost(params[2]);
}