1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Provides support for unreal-style umode +B */
18 /** Handles user mode +B
20 class BotMode : public SimpleUserModeHandler
23 BotMode(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'B') { }
26 class ModuleBotMode : public Module
31 ModuleBotMode(InspIRCd* Me)
35 bm = new BotMode(ServerInstance);
36 if (!ServerInstance->Modes->AddMode(bm))
37 throw ModuleException("Could not add new modes!");
38 Implementation eventlist[] = { I_OnWhois };
39 ServerInstance->Modules->Attach(eventlist, this, 1);
43 virtual ~ModuleBotMode()
45 ServerInstance->Modes->DelMode(bm);
49 virtual Version GetVersion()
51 return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
54 virtual void OnWhois(User* src, User* dst)
56 if (dst->IsModeSet('B'))
58 ServerInstance->SendWhoisLine(src, dst, 335, std::string(src->nick)+" "+std::string(dst->nick)+" :is a bot on "+ServerInstance->Config->Network);
65 MODULE_INIT(ModuleBotMode)