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, sizeof(eventlist)/sizeof(Implementation));
}
if (!dest->IsModeSet('W') || source == dest)
return;
- if (!ShowWhoisFromOpers && IS_OPER(source))
+ if (!ShowWhoisFromOpers && source->IsOper())
return;
if (IS_LOCAL(dest))
ServerInstance->PI->SendEncapsulatedData(params);
}
}
-
};
MODULE_INIT(ModuleShowwhois)
+