]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Move the <disabled> tag out of the core to a new module.
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index e0236bc17c4a8756b3a949bb537ee88b126c23df..1931666d1527997f9ab1394596b8485975ff73e0 100644 (file)
 
 
 #include "inspircd.h"
+#include "modules/whois.h"
 
-/** Handles user mode +B
- */
-class BotMode : public SimpleUserModeHandler
+enum
 {
- public:
-       BotMode(Module* Creator) : SimpleUserModeHandler(Creator, "bot", 'B') { }
+       // From UnrealIRCd.
+       RPL_WHOISBOT = 335
 };
 
 class ModuleBotMode : public Module, public Whois::EventListener
 {
-       BotMode bm;
+       SimpleUserModeHandler bm;
  public:
        ModuleBotMode()
                : Whois::EventListener(this)
-               , bm(this)
+               , bm(this, "bot", 'B')
        {
        }
 
@@ -48,7 +47,7 @@ class ModuleBotMode : public Module, public Whois::EventListener
        {
                if (whois.GetTarget()->IsModeSet(bm))
                {
-                       whois.SendLine(335, "is a bot on " + ServerInstance->Config->Network);
+                       whois.SendLine(RPL_WHOISBOT, "is a bot on " + ServerInstance->Config->Network);
                }
        }
 };