diff options
Diffstat (limited to 'src/modules/m_hideoper.cpp')
-rw-r--r-- | src/modules/m_hideoper.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index 03f6745ee..0fa5206ea 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -71,9 +71,9 @@ class ModuleHideOper : public Module, public Whois::LineEventListener hm.opercount--; } - ModResult OnNumeric(User* user, unsigned int numeric, const std::string& text) CXX11_OVERRIDE + ModResult OnNumeric(User* user, const Numeric::Numeric& numeric) CXX11_OVERRIDE { - if (numeric != 252 || active || user->HasPrivPermission("users/auspex")) + if (numeric.GetNumeric() != 252 || active || user->HasPrivPermission("users/auspex")) return MOD_RES_PASSTHRU; // If there are no visible operators then we shouldn't send the numeric. @@ -81,18 +81,18 @@ class ModuleHideOper : public Module, public Whois::LineEventListener if (opercount) { active = true; - user->WriteNumeric(252, "%lu :operator(s) online", opercount); + user->WriteNumeric(252, opercount, "operator(s) online"); active = false; } return MOD_RES_DENY; } - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the * person doing the WHOIS is not an oper */ - if (numeric != 313) + if (numeric.GetNumeric() != 313) return MOD_RES_PASSTHRU; if (!whois.GetTarget()->IsModeSet(hm)) @@ -122,9 +122,9 @@ class ModuleHideOper : public Module, public Whois::LineEventListener } } - ModResult OnStats(char symbol, User* user, string_list& results) CXX11_OVERRIDE + ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE { - if (symbol != 'P') + if (stats.GetSymbol() != 'P') return MOD_RES_PASSTHRU; unsigned int count = 0; @@ -132,15 +132,15 @@ class ModuleHideOper : public Module, public Whois::LineEventListener for (UserManager::OperList::const_iterator i = opers.begin(); i != opers.end(); ++i) { User* oper = *i; - if (!oper->server->IsULine() && (user->IsOper() || !oper->IsModeSet(hm))) + if (!oper->server->IsULine() && (stats.GetSource()->IsOper() || !oper->IsModeSet(hm))) { LocalUser* lu = IS_LOCAL(oper); - results.push_back("249 " + user->nick + " :" + oper->nick + " (" + oper->ident + "@" + oper->dhost + ") Idle: " + + stats.AddRow(249, 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)"); + stats.AddRow(249, ConvToStr(count)+" OPER(s)"); return MOD_RES_DENY; } |