3 // showwhois module by typobox43
9 #include "helperfuncs.h"
11 /* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
13 class ModuleShowwhois : public Module
18 ModuleShowwhois(Server* Me)
22 Srv->AddExtendedMode('W',MT_CLIENT,true,0,0);
29 void Implements(char* List)
31 List[I_OnWhois] = List[I_OnExtendedMode] = 1;
34 virtual Version GetVersion()
36 return Version(1,0,0,3,VF_STATIC);
39 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params)
41 if((type == MT_CLIENT) && (modechar == 'W'))
49 virtual void OnWhois(userrec* source, userrec* dest)
51 if((strchr(dest->modes,'W')) && (source != dest))
53 WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
59 class ModuleShowwhoisFactory : public ModuleFactory
62 ModuleShowwhoisFactory()
66 ~ModuleShowwhoisFactory()
70 virtual Module* CreateModule(Server* Me)
72 return new ModuleShowwhois(Me);
77 extern "C" void* init_module()
79 return new ModuleShowwhoisFactory;