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 */
14 class ModuleShowwhois : public Module {
22 Srv->AddExtendedMode('W',MT_CLIENT,true,0,0);
32 virtual Version GetVersion()
34 return Version(1,0,0,3,VF_STATIC);
37 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params) {
39 if((type == MT_CLIENT) && (modechar == 'W')) {
49 virtual void OnWhois(userrec* source, userrec* dest) {
51 if(strchr(dest->modes,'W')) {
53 WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
61 class ModuleShowwhoisFactory : public ModuleFactory {
65 ModuleShowwhoisFactory() {
69 ~ModuleShowwhoisFactory() {
73 virtual Module* CreateModule() {
75 return new ModuleShowwhois;
81 extern "C" void* init_module() {
83 return new ModuleShowwhoisFactory;