#include "users.h"
#include "channels.h"
#include "modules.h"
-#include "helperfuncs.h"
+
+#include "inspircd.h"
/* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
+
+
class SeeWhois : public ModeHandler
{
public:
- SeeWhois() : ModeHandler('W', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
{
class ModuleShowwhois : public Module
{
- Server* Srv;
+
SeeWhois* sw;
public:
- ModuleShowwhois(Server* Me) : Module::Module(Me)
+ ModuleShowwhois(InspIRCd* Me) : Module::Module(Me)
{
- Srv = Me;
- sw = new SeeWhois();
- Srv->AddMode(sw, 'W');
+
+ sw = new SeeWhois(ServerInstance);
+ ServerInstance->AddMode(sw, 'W');
}
~ModuleShowwhois()
{
if ((dest->IsModeSet('W')) && (source != dest))
{
- WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
+ dest->WriteServ("NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
}
}
{
}
- virtual Module* CreateModule(Server* Me)
+ virtual Module* CreateModule(InspIRCd* Me)
{
return new ModuleShowwhois(Me);
}