X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_showwhois.cpp;h=0719a93f83a7641843e5d8b68e60e3ad143ef863;hb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;hp=c7ba52035b3dc3a0b0b21ba83e299db72b273a0b;hpb=cbff8c76278f7cb706e3c4ae0c8bc4cb63c15f96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index c7ba52035..0719a93f8 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -6,14 +6,17 @@ using namespace std; #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) { @@ -44,16 +47,16 @@ class SeeWhois : public ModeHandler 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() @@ -75,7 +78,7 @@ class ModuleShowwhois : public Module { 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); } } @@ -92,7 +95,7 @@ class ModuleShowwhoisFactory : public ModuleFactory { } - virtual Module* CreateModule(Server* Me) + virtual Module* CreateModule(InspIRCd* Me) { return new ModuleShowwhois(Me); }