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 int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params) {
31 if((type == MT_CLIENT) && (modechar == 'W')) {
41 virtual void OnWhois(userrec* source, userrec* dest) {
43 if(strchr(dest->modes,'W')) {
45 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 {
57 ModuleShowwhoisFactory() {
61 ~ModuleShowwhoisFactory() {
65 virtual Module* CreateModule() {
67 return new ModuleShowwhois;
73 extern "C" void* init_module() {
75 return new ModuleShowwhoisFactory;