diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2012-12-05 06:18:36 +0100 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2012-12-05 06:18:36 +0100 |
commit | f711dd3460f15027c756805aa4339a108bcf812b (patch) | |
tree | 8f0795719fd87838b5c7d365c1a319c323c45327 /modules/protocol/ngircd.cpp | |
parent | 7a865b6b2828b417e4d91441e5437a7c826cdc80 (diff) |
ngircd protocol module: improved vhost support
Diffstat (limited to 'modules/protocol/ngircd.cpp')
-rw-r--r-- | modules/protocol/ngircd.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index af60df3c9..b5bf87b12 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -155,21 +155,18 @@ class ngIRCdProto : public IRCDProto { if (!vIdent.empty()) UplinkSocket::Message(Me) << "METADATA " << u->nick << " user :" << vIdent; - if (!vhost.empty()) + + UplinkSocket::Message(Me) << "METADATA " << u->nick << " cloakhost :" << vhost; + if (!u->HasMode(UMODE_CLOAK)) { - if (!u->HasMode(UMODE_CLOAK)) - { - u->SetMode(HostServ, UMODE_CLOAK); - // send the modechange before we send the vhost - ModeManager::ProcessModes(); - } - UplinkSocket::Message(Me) << "METADATA " << u->nick << " host :" << vhost; + u->SetMode(HostServ, UMODE_CLOAK); + ModeManager::ProcessModes(); } } void SendVhostDel(User *u) anope_override { - this->SendVhost(u, u->GetIdent(), u->GetCloakedHost()); + this->SendVhost(u, u->GetIdent(), ""); } }; @@ -333,6 +330,7 @@ struct IRCDMessageMetadata : IRCDMessage * * following commands are supported: * - "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 * - "user": the user name (ident) of a client (can't be empty) */ @@ -349,6 +347,11 @@ struct IRCDMessageMetadata : IRCDMessage { u->SetCloakedHost(params[2]); } + else if (params[1].equals_cs("cloakhost")) + { + if (!params[2].empty()) + u->SetDisplayedHost(params[2]); + } else if (params[1].equals_cs("info")) { u->SetRealname(params[2]); |