]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Prepend target user nick to whois numerics in InspIRCd::SendWhoisLine()
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index 23094ddc55f0a4c4557aba85248513d48c87f12d..56c94c7c7506cee76e8afbb0c53a5eb7e51f17f6 100644 (file)
@@ -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
@@ -38,31 +36,20 @@ class ModuleBotMode : public Module
        ModuleBotMode()
                : bm(this)
        {
-               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, ":is a bot on "+ServerInstance->Config->Network);
                }
        }
-
 };
 
-
 MODULE_INIT(ModuleBotMode)