diff options
Diffstat (limited to 'modules/protocol/ngircd.cpp')
-rw-r--r-- | modules/protocol/ngircd.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index d32d87a73..9f9464f24 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -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]); } |