class cmd_helpop : public command_t
{
public:
- cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 1)
- {
- this->source = "m_helpop.so";
- syntax = "<any-text>";
- }
+ cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 0)
+ {
+ this->source = "m_helpop.so";
+ syntax = "<any-text>";
+ }
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);
{
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);
}
List[I_OnRehash] = List[I_OnWhois] = 1;
}
- virtual void OnRehash(const std::string ¶meter)
+ virtual void OnRehash(userrec* user, const std::string ¶meter)
{
ReadConfig();
}