1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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, Module* Creator) : SimpleUserModeHandler(Creator, 'B') { }
26 class ModuleBotMode : public Module
30 ModuleBotMode(InspIRCd* Me)
31 : Module(Me), bm(Me, this)
33 if (!ServerInstance->Modes->AddMode(&bm))
34 throw ModuleException("Could not add new modes!");
35 Implementation eventlist[] = { I_OnWhois };
36 ServerInstance->Modules->Attach(eventlist, this, 1);
40 virtual ~ModuleBotMode()
42 ServerInstance->Modes->DelMode(&bm);
45 virtual Version GetVersion()
47 return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
50 virtual void OnWhois(User* src, User* dst)
52 if (dst->IsModeSet('B'))
54 ServerInstance->SendWhoisLine(src, dst, 335, std::string(src->nick)+" "+std::string(dst->nick)+" :is a bot on "+ServerInstance->Config->Network);
61 MODULE_INIT(ModuleBotMode)