X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_swhois.cpp;h=e75921a801a494bc1142959812da62108a5c0a21;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=4eb2a9cdab774a3e9c3071c50c13e056cbeca9f1;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 4eb2a9cda..e75921a80 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -31,7 +31,9 @@ class CommandSwhois : public Command { public: StringExtItem swhois; - CommandSwhois(Module* Creator) : Command(Creator,"SWHOIS", 2,2), swhois("swhois", Creator) + CommandSwhois(Module* Creator) + : Command(Creator, "SWHOIS", 2, 2) + , swhois("swhois", ExtensionItem::EXT_USER, Creator) { flags_needed = 'o'; syntax = " :"; TRANSLATE2(TR_NICK, TR_TEXT); @@ -79,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 :%s", dest->nick.c_str(), swhois->c_str()); + whois.SendLine(320, ":%s", swhois->c_str()); } }