X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_maphide.cpp;h=546e342ae36180d4644921501689e8b6c24b6f3f;hb=e5518238259b9988a2a6d8ef654b69034628c10d;hp=f3f4725191ffd919888b5acb6948deba945a9245;hpb=a4db7bf9af00b32d4f5c1922997d02b0b8be59e5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_maphide.cpp b/src/modules/m_maphide.cpp index f3f472519..546e342ae 100644 --- a/src/modules/m_maphide.cpp +++ b/src/modules/m_maphide.cpp @@ -25,10 +25,10 @@ class ModuleMapHide : public Module { std::string url; public: - ModuleMapHide() + 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;