diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-07-25 12:05:40 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-07-25 12:05:40 +0200 |
commit | f62654a6859998f9d63eb22702c572d5ebcff15c (patch) | |
tree | fd38985a6a7f94658c157da9a6f470d718f34eed /src/modules/m_hideoper.cpp | |
parent | 9c285d9546ea5b99a5ae1ac5186206308ca2d38f (diff) | |
parent | 2cc3d7ecb8cd77341215db5bb94cebf917a5c5ef (diff) |
Merge insp20
Diffstat (limited to 'src/modules/m_hideoper.cpp')
-rw-r--r-- | src/modules/m_hideoper.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index d3c2bf444..5b226f3b8 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -76,6 +76,29 @@ class ModuleHideOper : public Module line.clear(); } } + + ModResult OnStats(char symbol, User* user, string_list& results) CXX11_OVERRIDE + { + if (symbol != 'P') + return MOD_RES_PASSTHRU; + + unsigned int count = 0; + const UserManager::OperList& opers = ServerInstance->Users->all_opers; + for (UserManager::OperList::const_iterator i = opers.begin(); i != opers.end(); ++i) + { + User* oper = *i; + if (!oper->server->IsULine() && (user->IsOper() || !oper->IsModeSet(hm))) + { + LocalUser* lu = IS_LOCAL(oper); + results.push_back("249 " + user->nick + " :" + oper->nick + " (" + oper->ident + "@" + oper->dhost + ") Idle: " + + (lu ? ConvToStr(ServerInstance->Time() - lu->idle_lastmsg) + " secs" : "unavailable")); + count++; + } + } + results.push_back("249 "+user->nick+" :"+ConvToStr(count)+" OPER(s)"); + + return MOD_RES_DENY; + } }; MODULE_INIT(ModuleHideOper) |