+ if (numeric != 313)
+ return MOD_RES_PASSTHRU;
+
+ if (!dest->IsModeSet('H'))
+ return MOD_RES_PASSTHRU;
+
+ if (!user->HasPrivPermission("users/auspex"))
+ return MOD_RES_DENY;
+
+ return MOD_RES_PASSTHRU;
+ }
+
+ void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line)
+ {
+ if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex"))
+ {
+ // hide the "*" that marks the user as an oper from the /WHO line
+ std::string::size_type spcolon = line.find(" :");
+ if (spcolon == std::string::npos)
+ return; // Another module hid the user completely
+ std::string::size_type sp = line.rfind(' ', spcolon-1);
+ std::string::size_type pos = line.find('*', sp);
+ if (pos != std::string::npos)
+ line.erase(pos, 1);
+ // hide the line completely if doing a "/who * o" query
+ if (params.size() > 1 && params[1].find('o') != std::string::npos)
+ line.clear();
+ }
+ }
+
+ ModResult OnStats(char symbol, User* user, string_list &results)
+ {
+ if (symbol != 'P')
+ return MOD_RES_PASSTHRU;
+
+ unsigned int count = 0;
+ for (std::list<User*>::const_iterator i = ServerInstance->Users->all_opers.begin(); i != ServerInstance->Users->all_opers.end(); ++i)
+ {
+ User* oper = *i;
+ if (!ServerInstance->ULine(oper->server) && (IS_OPER(user) || !oper->IsModeSet('H')))
+ {
+ results.push_back(ServerInstance->Config->ServerName+" 249 " + user->nick + " :" + oper->nick + " (" + oper->ident + "@" + oper->dhost + ") Idle: " +
+ (IS_LOCAL(oper) ? ConvToStr(ServerInstance->Time() - oper->idle_lastmsg) + " secs" : "unavailable"));
+ count++;
+ }
+ }
+ results.push_back(ServerInstance->Config->ServerName+" 249 "+user->nick+" :"+ConvToStr(count)+" OPER(s)");
+
+ return MOD_RES_DENY;