X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_showwhois.cpp;h=398ebf571bda40d549319385a4aed41536d7550a;hb=ccd4c11ea1a43d079eaae9708482ef4a9148796c;hp=3b2ea7de9005715f2f498cf72479a8dc7e51b1b1;hpb=a4db7bf9af00b32d4f5c1922997d02b0b8be59e5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index 3b2ea7de9..398ebf571 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -39,7 +39,7 @@ class SeeWhois : public SimpleUserModeHandler class WhoisNoticeCmd : public Command { public: - WhoisNoticeCmd(Module* Creator) : Command(Creator,"WHOISNOTICE", 1) + WhoisNoticeCmd(Module* Creator) : Command(Creator,"WHOISNOTICE", 2) { flags_needed = FLAG_SERVERONLY; } @@ -74,7 +74,12 @@ class ModuleShowwhois : public Module public: - ModuleShowwhois() : cmd(this) + ModuleShowwhois() + : sw(NULL), cmd(this) + { + } + + void init() { ConfigTag* tag = ServerInstance->Config->ConfValue("showwhois"); @@ -82,11 +87,10 @@ class ModuleShowwhois : public Module 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()