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 * ---------------------------------------------------
25 /* $ModDesc: Provides support for unreal-style umode +B */
27 class ModuleBotMode : public Module
35 if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
37 Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
38 printf("Could not claim usermode +B for this module!");
43 virtual ~ModuleBotMode()
48 virtual Version GetVersion()
50 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
53 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
55 if ((modechar == 'B') && (type == MT_CLIENT))
65 virtual void OnWhois(userrec* src, userrec* dst)
67 if (strchr(dst->modes,'B'))
69 Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
75 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
77 class ModuleBotModeFactory : public ModuleFactory
80 ModuleBotModeFactory()
84 ~ModuleBotModeFactory()
88 virtual Module * CreateModule()
90 return new ModuleBotMode;
96 extern "C" void * init_module( void )
98 return new ModuleBotModeFactory;