From 8f34594cb7d600ccff100dff1817b69b03756ea2 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 28 Apr 2015 15:16:22 +0200 Subject: Move OnWhois* events to core_whois, add Whois::Context Remove InspIRCd::SendWhoisLine() --- src/modules/m_swhois.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/m_swhois.cpp') diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index ddc3726be..e75921a80 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -81,26 +81,28 @@ class CommandSwhois : public Command }; -class ModuleSWhois : public Module +class ModuleSWhois : public Module, public Whois::LineEventListener { CommandSwhois cmd; public: - ModuleSWhois() : cmd(this) + ModuleSWhois() + : Whois::LineEventListener(this) + , cmd(this) { } // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games. - ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE { /* We use this and not OnWhois because this triggers for remote, too */ if (numeric == 312) { /* Insert our numeric before 312 */ - std::string* swhois = cmd.swhois.get(dest); + std::string* swhois = cmd.swhois.get(whois.GetTarget()); if (swhois) { - ServerInstance->SendWhoisLine(user, dest, 320, ":%s", swhois->c_str()); + whois.SendLine(320, ":%s", swhois->c_str()); } } -- cgit v1.3.1-10-gc9f91