#include "inspircd.h"
-/* $ModDesc: Provides user mode +B to mark the user as a bot */
-
/** Handles user mode +B
*/
class BotMode : public SimpleUserModeHandler
{
}
- void init()
- {
- if (!ServerInstance->Modes->AddMode(&bm))
- throw ModuleException("Could not add new modes!");
- Implementation eventlist[] = { I_OnWhois };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
- }
-
- virtual ~ModuleBotMode()
- {
- }
-
- virtual Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides user mode +B to mark the user as a bot",VF_VENDOR);
}
- virtual void OnWhois(User* src, User* dst)
+ void OnWhois(User* src, User* dst) CXX11_OVERRIDE
{
- if (dst->IsModeSet('B'))
+ if (dst->IsModeSet(bm))
{
- ServerInstance->SendWhoisLine(src, dst, 335, src->nick+" "+dst->nick+" :is a bot on "+ServerInstance->Config->Network);
+ ServerInstance->SendWhoisLine(src, dst, 335, dst->nick+" :is a bot on "+ServerInstance->Config->Network);
}
}
-
};
-
MODULE_INIT(ModuleBotMode)