3 // showwhois module by typobox43
8 #include "helperfuncs.h"
10 /* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
12 class ModuleShowwhois : public Module
17 ModuleShowwhois(Server* Me)
21 Srv->AddExtendedMode('W',MT_CLIENT,true,0,0);
28 virtual Version GetVersion()
30 return Version(1,0,0,3,VF_STATIC);
33 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params)
35 if((type == MT_CLIENT) && (modechar == 'W'))
43 virtual void OnWhois(userrec* source, userrec* dest)
45 if(strchr(dest->modes,'W'))
47 WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
53 class ModuleShowwhoisFactory : public ModuleFactory
56 ModuleShowwhoisFactory()
60 ~ModuleShowwhoisFactory()
64 virtual Module* CreateModule(Server* Me)
66 return new ModuleShowwhois(Me);
71 extern "C" void* init_module()
73 return new ModuleShowwhoisFactory;