diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-05-04 13:24:48 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-05-04 13:24:48 +0200 |
commit | 4711113dff7fc33c96f95f417f2813f28c690e01 (patch) | |
tree | 7ccecb9e52f6c13c233a3efe312410a1c8e526a0 /src/modules/m_botmode.cpp | |
parent | 8aa03e455e14ea85cdee65527565975ddf558b88 (diff) | |
parent | 68bb6a67459298ca08eb18b60794619ddf782c77 (diff) |
Merge branch 'master+whoiscontext'
Diffstat (limited to 'src/modules/m_botmode.cpp')
-rw-r--r-- | src/modules/m_botmode.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 67f692b86..419af0153 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -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, dst->nick+" :is a bot on "+ServerInstance->Config->Network); + whois.SendLine(335, ":is a bot on " + ServerInstance->Config->Network); } } }; |