X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_hideoper.cpp;h=3ea653a75d1c145bad28533d0b9afc4510bdc0b8;hb=fd1d19d6345943ecdb5ce4ef947f9b3c5c8bca86;hp=fe06ad8c69bee21564d2958881649527c4343d50;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index fe06ad8c6..3ea653a75 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides support for hiding oper status with user mode +H */ - /** Handles user mode +H */ class HideOper : public SimpleUserModeHandler @@ -43,25 +41,19 @@ class ModuleHideOper : public Module { } - void init() + void init() CXX11_OVERRIDE { - if (!ServerInstance->Modes->AddMode(&hm)) - throw ModuleException("Could not add new modes!"); + ServerInstance->Modules->AddService(hm); Implementation eventlist[] = { I_OnWhoisLine, I_OnSendWhoLine }; - ServerInstance->Modules->Attach(eventlist, this, 2); - } - - - virtual ~ModuleHideOper() - { + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for hiding oper status with user mode +H", VF_VENDOR); } - ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) + ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE { /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the * person doing the WHOIS is not an oper @@ -69,7 +61,7 @@ class ModuleHideOper : public Module if (numeric != 313) return MOD_RES_PASSTHRU; - if (!dest->IsModeSet('H')) + if (!dest->IsModeSet(hm)) return MOD_RES_PASSTHRU; if (!user->HasPrivPermission("users/auspex")) @@ -78,9 +70,9 @@ class ModuleHideOper : public Module return MOD_RES_PASSTHRU; } - void OnSendWhoLine(User* source, const std::vector& params, User* user, std::string& line) + void OnSendWhoLine(User* source, const std::vector& params, User* user, std::string& line) CXX11_OVERRIDE { - if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex")) + if (user->IsModeSet(hm) && !source->HasPrivPermission("users/auspex")) { // hide the "*" that marks the user as an oper from the /WHO line std::string::size_type pos = line.find("*"); @@ -93,5 +85,4 @@ class ModuleHideOper : public Module } }; - MODULE_INIT(ModuleHideOper)