X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_helpop.cpp;h=f82004f162f09fb022e1dc62825ca6aab9aa9dbf;hb=dd283acb933c541ce1be6532f8c6f37528b41c51;hp=f501676c3070a55dc2c70d17446dc06334bb0c95;hpb=c44487d3b4e67fbbd5f736bc29da0eac3a83f4a3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index f501676c3..f82004f16 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -55,17 +55,19 @@ class Helpop : public ModeHandler class cmd_helpop : public command_t { public: - cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 1) - { - this->source = "m_helpop.so"; - syntax = ""; - } + cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 0) + { + this->source = "m_helpop.so"; + syntax = ""; + } CmdResult Handle (const char** parameters, int pcnt, userrec *user) - { - irc::string parameter = parameters[0]; + { + irc::string parameter; + if (pcnt > 0) + parameter = parameters[0]; - if (parameter == "index") + if (pcnt == 0 || parameter == "index") { /* iterate over all helpop items */ user->WriteServ("NOTICE %s :HELPOP topic index", user->nick); @@ -118,7 +120,8 @@ class ModuleHelpop : public Module { ReadConfig(); ho = new Helpop(ServerInstance); - ServerInstance->AddMode(ho, 'h'); + if (!ServerInstance->AddMode(ho, 'h')) + throw ModuleException("Could not add new modes!"); mycommand = new cmd_helpop(ServerInstance); ServerInstance->AddCommand(mycommand); } @@ -160,7 +163,7 @@ class ModuleHelpop : public Module List[I_OnRehash] = List[I_OnWhois] = 1; } - virtual void OnRehash(const std::string ¶meter) + virtual void OnRehash(userrec* user, const std::string ¶meter) { ReadConfig(); }