1 // showwhois module by typobox43
7 /* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
11 class ModuleShowwhois : public Module {
19 Srv->AddExtendedMode('W',MT_CLIENT,true,0,0);
29 virtual Version GetVersion()
31 return Version(1,0,0,3,VF_STATIC);
34 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params) {
36 if((type == MT_CLIENT) && (modechar == 'W')) {
46 virtual void OnWhois(userrec* source, userrec* dest) {
48 if(strchr(dest->modes,'W')) {
50 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 {
62 ModuleShowwhoisFactory() {
66 ~ModuleShowwhoisFactory() {
70 virtual Module* CreateModule() {
72 return new ModuleShowwhois;
78 extern "C" void* init_module() {
80 return new ModuleShowwhoisFactory;