diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2013-08-31 08:46:56 +0200 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2013-08-31 08:46:56 +0200 |
commit | 752a5ca1b7d89044728a045622b3f3db5fb94f7e (patch) | |
tree | bb269ec3ad50ff4ac4f50b3fd50cf9f7feb60925 | |
parent | e1a1cf0e6f62c374f952103e50d302cb17462833 (diff) |
add vhost support for hybrid
-rw-r--r-- | include/users.h | 6 | ||||
-rw-r--r-- | modules/protocol/hybrid.cpp | 12 | ||||
-rw-r--r-- | src/users.cpp | 8 |
3 files changed, 20 insertions, 6 deletions
diff --git a/include/users.h b/include/users.h index 26aeb24bb..8b8237af0 100644 --- a/include/users.h +++ b/include/users.h @@ -282,14 +282,16 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe /** Remove a mode on the user * @param bi The client setting the mode * @param um The user mode + * @param param Optional param for the mode */ - void RemoveMode(BotInfo *bi, UserMode *um); + void RemoveMode(BotInfo *bi, UserMode *um, const Anope::string ¶m = ""); /** Remove a mode from the user * @param bi The client setting the mode * @param name The mode name + * @param param Optional param for the mode */ - void RemoveMode(BotInfo *bi, const Anope::string &name); + void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = ""); /** Set a string of modes on a user * @param bi The client setting the modes diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index f4254edf4..997513f7e 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -26,6 +26,7 @@ class HybridProto : public IRCDProto CanSZLine = true; CanSVSHold = true; CanCertFP = true; + CanSetVHost = true; RequiresID = true; MaxModes = 4; } @@ -260,6 +261,16 @@ class HybridProto : public IRCDProto this->SendSQLineDel(&x); } + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + { + u->SetMode(Config->GetClient("HostServ"), "CLOAK", host); + } + + void SendVhostDel(User *u) anope_override + { + u->RemoveMode(Config->GetClient("HostServ"), "CLOAK", u->host); + } + bool IsIdentValid(const Anope::string &ident) anope_override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen")) @@ -603,6 +614,7 @@ class ProtoHybrid : public Module ModeManager::AddUserMode(new UserModeOperOnly("HIDEOPER", 'H')); ModeManager::AddUserMode(new UserMode("REGPRIV", 'R')); ModeManager::AddUserMode(new UserModeNoone("SSL", 'S')); + ModeManager::AddUserMode(new UserMode("CLOAK", 'x')); /* b/e/I */ ModeManager::AddChannelMode(new ChannelModeList("BAN", 'b')); diff --git a/src/users.cpp b/src/users.cpp index 3c99b46e6..07aa0fabe 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -488,18 +488,18 @@ void User::SetMode(BotInfo *bi, const Anope::string &uname, const Anope::string SetMode(bi, ModeManager::FindUserModeByName(uname), param); } -void User::RemoveMode(BotInfo *bi, UserMode *um) +void User::RemoveMode(BotInfo *bi, UserMode *um, const Anope::string ¶m) { if (!um || !HasMode(um->name)) return; - ModeManager::StackerAdd(bi, this, um, false); + ModeManager::StackerAdd(bi, this, um, false, param); RemoveModeInternal(bi, um); } -void User::RemoveMode(BotInfo *bi, const Anope::string &name) +void User::RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m) { - RemoveMode(bi, ModeManager::FindUserModeByName(name)); + RemoveMode(bi, ModeManager::FindUserModeByName(name), param); } void User::SetModes(BotInfo *bi, const char *umodes, ...) |