]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Allow the maximum length of a chanfilter message to be configured.
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index e0236bc17c4a8756b3a949bb537ee88b126c23df..1544562c060b5fb061e8c7b5417d452cceb50d7f 100644 (file)
 
 #include "inspircd.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 +46,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);
                }
        }
 };