diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-12-06 11:00:12 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-12-06 11:00:12 +0100 |
commit | e4b17fd39b476fefec73d0956e6f40bd7ec254fc (patch) | |
tree | 7cd75186208c5c8b897a88543bdcb379539e833e /src/modules/m_hostcycle.cpp | |
parent | 33691d74dfb8b110c3c4247321fdc628bf680608 (diff) | |
parent | ecca6c2300056f1cff1a9c7cac03939ea3f6f9cc (diff) |
Merge branch 'master+cap'
Diffstat (limited to 'src/modules/m_hostcycle.cpp')
-rw-r--r-- | src/modules/m_hostcycle.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_hostcycle.cpp b/src/modules/m_hostcycle.cpp index d4def6473..b33c101ef 100644 --- a/src/modules/m_hostcycle.cpp +++ b/src/modules/m_hostcycle.cpp @@ -19,12 +19,15 @@ #include "inspircd.h" +#include "modules/cap.h" class ModuleHostCycle : public Module { + Cap::Reference chghostcap; + /** Send fake quit/join/mode messages for host or ident cycle. */ - static void DoHostCycle(User* user, const std::string& newident, const std::string& newhost, const char* quitmsg) + void DoHostCycle(User* user, const std::string& newident, const std::string& newhost, const char* quitmsg) { // GetFullHost() returns the original data at the time this function is called const std::string quitline = ":" + user->GetFullHost() + " QUIT :" + quitmsg; @@ -40,7 +43,7 @@ class ModuleHostCycle : public Module for (std::map<User*,bool>::iterator i = exceptions.begin(); i != exceptions.end(); ++i) { LocalUser* u = IS_LOCAL(i->first); - if (u && !u->quitting) + if ((u) && (!u->quitting) && (!chghostcap.get(u))) { if (i->second) { @@ -80,6 +83,8 @@ class ModuleHostCycle : public Module continue; if (u->already_sent == silent_id) continue; + if (chghostcap.get(u)) + continue; if (u->already_sent != seen_id) { @@ -95,6 +100,11 @@ class ModuleHostCycle : public Module } public: + ModuleHostCycle() + : chghostcap(this, "chghost") + { + } + void OnChangeIdent(User* user, const std::string& newident) CXX11_OVERRIDE { DoHostCycle(user, newident, user->dhost, "Changing ident"); |