1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
23 /* $ModDesc: Provides support for unreal-style umode +B */
25 class ModuleBotMode : public Module
33 if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
35 Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
36 printf("Could not claim usermode +B for this module!");
41 virtual ~ModuleBotMode()
46 virtual Version GetVersion()
48 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
51 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
53 if ((modechar == 'B') && (type == MT_CLIENT))
63 virtual void OnWhois(userrec* src, userrec* dst)
65 if (strchr(dst->modes,'B'))
67 Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
73 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
75 class ModuleBotModeFactory : public ModuleFactory
78 ModuleBotModeFactory()
82 ~ModuleBotModeFactory()
86 virtual Module * CreateModule()
88 return new ModuleBotMode;
94 extern "C" void * init_module( void )
96 return new ModuleBotModeFactory;