X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_maphide.cpp;h=546e342ae36180d4644921501689e8b6c24b6f3f;hb=4d41afdc2ecf36017154e7a460457c076c8aaa16;hp=de4c82fa4966583655f70dbef1b90d2285f24690;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_maphide.cpp b/src/modules/m_maphide.cpp index de4c82fa4..546e342ae 100644 --- a/src/modules/m_maphide.cpp +++ b/src/modules/m_maphide.cpp @@ -28,7 +28,7 @@ class ModuleMapHide : public Module void init() { Implementation eventlist[] = { I_OnPreCommand, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); } @@ -39,7 +39,7 @@ class ModuleMapHide : public Module ModResult OnPreCommand(std::string &command, std::vector ¶meters, LocalUser *user, bool validated, const std::string &original_line) { - if (!IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS")) + if (validated && !IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS")) { user->WriteServ("NOTICE %s :/%s has been disabled; visit %s", user->nick.c_str(), command.c_str(), url.c_str()); return MOD_RES_DENY;