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 void Implements(char* List)
30 List[I_OnWhois] = List[I_OnExtendedMode] = 1;
33 virtual Version GetVersion()
35 return Version(1,0,0,3,VF_STATIC);
38 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params)
40 if((type == MT_CLIENT) && (modechar == 'W'))
48 virtual void OnWhois(userrec* source, userrec* dest)
50 if(strchr(dest->modes,'W'))
52 WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
58 class ModuleShowwhoisFactory : public ModuleFactory
61 ModuleShowwhoisFactory()
65 ~ModuleShowwhoisFactory()
69 virtual Module* CreateModule(Server* Me)
71 return new ModuleShowwhois(Me);
76 extern "C" void* init_module()
78 return new ModuleShowwhoisFactory;