X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_botmode.cpp;h=67f692b8623077a4fd40b77a42f163f5346bcc86;hb=43b5073d6f80a8dcb7044ecd127fd5893da033ab;hp=3e7fd2fc659e5e3b377a6c165745e639c4237ab3;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 3e7fd2fc6..67f692b86 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides user mode +B to mark the user as a bot */ - /** Handles user mode +B */ class BotMode : public SimpleUserModeHandler @@ -40,32 +38,18 @@ class ModuleBotMode : public Module { } - void init() - { - if (!ServerInstance->Modes->AddMode(&bm)) - throw ModuleException("Could not add new modes!"); - Implementation eventlist[] = { I_OnWhois }; - ServerInstance->Modules->Attach(eventlist, this, 1); - } - - 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)