class WhoisNoticeCmd : public Command
{
public:
- WhoisNoticeCmd(Module* Creator) : Command(Creator,"WHOISNOTICE", 1)
+ WhoisNoticeCmd(Module* Creator) : Command(Creator,"WHOISNOTICE", 2)
{
flags_needed = FLAG_SERVERONLY;
}
public:
- ModuleShowwhois() : cmd(this)
+ ModuleShowwhois()
+ : sw(NULL), cmd(this)
+ {
+ }
+
+ void init()
{
ConfigTag* tag = ServerInstance->Config->ConfValue("showwhois");
ShowWhoisFromOpers = tag->getBool("showfromopers", true);
sw = new SeeWhois(this, OpersOnly);
- if (!ServerInstance->Modes->AddMode(sw))
- throw ModuleException("Could not add new modes!");
- ServerInstance->AddCommand(&cmd);
+ ServerInstance->Modules->AddService(*sw);
+ ServerInstance->Modules->AddService(cmd);
Implementation eventlist[] = { I_OnWhois };
- ServerInstance->Modules->Attach(eventlist, this, 1);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
~ModuleShowwhois()