1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 * ---------------------------------------------------
25 /* $ModDesc: Provides support for unreal-style umode +B */
27 class ModuleBotMode : public Module
31 ModuleBotMode(Server* Me)
36 if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
38 Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
43 void Implements(char* List)
45 List[I_OnWhois] = List[I_OnExtendedMode] = 1;
48 virtual ~ModuleBotMode()
52 virtual Version GetVersion()
54 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
57 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
59 if ((modechar == 'B') && (type == MT_CLIENT))
69 virtual void OnWhois(userrec* src, userrec* dst)
71 if (strchr(dst->modes,'B'))
73 Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
79 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
81 class ModuleBotModeFactory : public ModuleFactory
84 ModuleBotModeFactory()
88 ~ModuleBotModeFactory()
92 virtual Module * CreateModule(Server* Me)
94 return new ModuleBotMode(Me);
100 extern "C" void * init_module( void )
102 return new ModuleBotModeFactory;