]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
core_hostname_lookup: find answer record of the correct type instead of assuming...
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index 3702284884ab349617618a78f096150e7a46aa4c..e0236bc17c4a8756b3a949bb537ee88b126c23df 100644 (file)
@@ -29,12 +29,13 @@ class BotMode : public SimpleUserModeHandler
        BotMode(Module* Creator) : SimpleUserModeHandler(Creator, "bot", 'B') { }
 };
 
-class ModuleBotMode : public Module
+class ModuleBotMode : public Module, public Whois::EventListener
 {
        BotMode bm;
  public:
        ModuleBotMode()
-               : bm(this)
+               : Whois::EventListener(this)
+               , bm(this)
        {
        }
 
@@ -43,11 +44,11 @@ class ModuleBotMode : public Module
                return Version("Provides user mode +B to mark the user as a bot",VF_VENDOR);
        }
 
-       void OnWhois(User* src, User* dst) CXX11_OVERRIDE
+       void OnWhois(Whois::Context& whois) CXX11_OVERRIDE
        {
-               if (dst->IsModeSet(bm))
+               if (whois.GetTarget()->IsModeSet(bm))
                {
-                       ServerInstance->SendWhoisLine(src, dst, 335, src->nick+" "+dst->nick+" :is a bot on "+ServerInstance->Config->Network);
+                       whois.SendLine(335, "is a bot on " + ServerInstance->Config->Network);
                }
        }
 };