class SeeWhois : public ModeHandler
{
public:
- SeeWhois(InspIRCd* Instance, bool IsOpersOnly) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_USER, IsOpersOnly) { }
+ SeeWhois(Module* Creator, bool IsOpersOnly) : ModeHandler(Creator, "showwhois", 'W', PARAM_NONE, MODETYPE_USER)
+ {
+ oper = IsOpersOnly;
+ }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
if (adding)
{
class WhoisNoticeCmd : public Command
{
public:
- WhoisNoticeCmd(InspIRCd* Instance) : Command(Instance,"WHOISNOTICE", 0, 1)
+ WhoisNoticeCmd(Module* Creator) : Command(Creator,"WHOISNOTICE", 1)
{
- this->source = "m_showwhois.cpp";
}
void HandleFast(User* dest, User* src)
public:
- ModuleShowwhois(InspIRCd* Me) : Module(Me), cmd(Me)
+ ModuleShowwhois() : cmd(this)
{
- ConfigReader conf(ServerInstance);
+ ConfigReader conf;
bool OpersOnly = conf.ReadFlag("showwhois", "opersonly", "yes", 0);
ShowWhoisFromOpers = conf.ReadFlag("showwhois", "showfromopers", "yes", 0);
- sw = new SeeWhois(ServerInstance, OpersOnly);
+ sw = new SeeWhois(this, OpersOnly);
if (!ServerInstance->Modes->AddMode(sw))
throw ModuleException("Could not add new modes!");
ServerInstance->AddCommand(&cmd);
~ModuleShowwhois()
{
- ServerInstance->Modes->DelMode(sw);
delete sw;
}
virtual Version GetVersion()
{
- return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
+ return Version("Allows opers to set +W to see when a user uses WHOIS on them",VF_COMMON|VF_VENDOR,API_VERSION);
}
virtual void OnWhois(User* source, User* dest)