- ConfigReader conf(ServerInstance);
- bool OpersOnly = conf.ReadFlag("showwhois", "opersonly", "yes", 0);
- ShowWhoisFromOpers = conf.ReadFlag("showwhois", "showfromopers", "yes", 0);
-
- sw = new SeeWhois(ServerInstance, OpersOnly);
- if (!ServerInstance->Modes->AddMode(sw))
- throw ModuleException("Could not add new modes!");
- ServerInstance->AddCommand(&cmd);
+ ConfigTag* tag = ServerInstance->Config->ConfValue("showwhois");
+
+ bool OpersOnly = tag->getBool("opersonly", true);
+ ShowWhoisFromOpers = tag->getBool("showfromopers", true);
+
+ sw = new SeeWhois(this, OpersOnly);
+ ServerInstance->Modules->AddService(*sw);
+ ServerInstance->Modules->AddService(cmd);