diff options
| author | 2016-02-25 16:27:30 +0100 | |
|---|---|---|
| committer | 2016-02-25 16:27:30 +0100 | |
| commit | 0c42bcde16c3141ccd4bb8c5f7b22d65cc8e1909 (patch) | |
| tree | f80ce6d1bd6346c9d9b4daa5350e6703e2738808 /src/modules | |
| parent | Convert WriteNumeric() calls to pass the parameters of the numeric as method ... (diff) | |
Convert WhoisContext::SendLine() calls to pass the parameters of the numeric as method parameters
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_botmode.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_customtitle.cpp | 6 | ||||
| -rw-r--r-- | src/modules/m_helpop.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_hidechans.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_hideoper.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_services_account.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_servprotect.cpp | 6 | ||||
| -rw-r--r-- | src/modules/m_sslinfo.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_swhois.cpp | 6 |
9 files changed, 19 insertions, 19 deletions
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 419af0153..e0236bc17 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -48,7 +48,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(335, "is a bot on " + ServerInstance->Config->Network); } } }; diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index b86bf1809..30c0aa4f2 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -82,16 +82,16 @@ class ModuleCustomTitle : public Module, public Whois::LineEventListener } // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games. - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { /* We use this and not OnWhois because this triggers for remote, too */ - if (numeric == 312) + if (numeric.GetNumeric() == 312) { /* Insert our numeric before 312 */ const std::string* ctitle = cmd.ctitle.get(whois.GetTarget()); if (ctitle) { - whois.SendLine(320, ":%s", ctitle->c_str()); + whois.SendLine(320, ctitle); } } /* Don't block anything */ diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index f567aa076..95f69774b 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -145,7 +145,7 @@ class ModuleHelpop : public Module, public Whois::EventListener { if (whois.GetTarget()->IsModeSet(ho)) { - whois.SendLine(310, ":is available for help."); + whois.SendLine(310, "is available for help."); } } diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index 431b7b968..08caae6b2 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -49,14 +49,14 @@ class ModuleHideChans : public Module, public Whois::LineEventListener AffectsOpers = ServerInstance->Config->ConfValue("hidechans")->getBool("affectsopers"); } - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { /* always show to self */ if (whois.IsSelfWhois()) return MOD_RES_PASSTHRU; /* don't touch anything except 319 */ - if (numeric != 319) + if (numeric.GetNumeric() != 319) return MOD_RES_PASSTHRU; /* don't touch if -I */ diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index b90f3f234..92af045d5 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -87,12 +87,12 @@ class ModuleHideOper : public Module, public Whois::LineEventListener return MOD_RES_DENY; } - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the * person doing the WHOIS is not an oper */ - if (numeric != 313) + if (numeric.GetNumeric() != 313) return MOD_RES_PASSTHRU; if (!whois.GetTarget()->IsModeSet(hm)) diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 048e04a5a..559f28ea8 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -168,13 +168,13 @@ class ModuleServicesAccount : public Module, public Whois::EventListener if (account) { - whois.SendLine(330, "%s :is logged in as", account->c_str()); + whois.SendLine(330, *account, "is logged in as"); } if (whois.GetTarget()->IsModeSet(m5)) { /* user is registered */ - whois.SendLine(307, ":is a registered nick"); + whois.SendLine(307, "is a registered nick"); } } diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 34f730c62..88bde9b57 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -62,7 +62,7 @@ class ModuleServProtectMode : public Module, public Whois::EventListener, public { if (whois.GetTarget()->IsModeSet(bm)) { - whois.SendLine(310, ":is a Network Service on " + ServerInstance->Config->Network); + whois.SendLine(310, "is a Network Service on " + ServerInstance->Config->Network); } } @@ -120,9 +120,9 @@ class ModuleServProtectMode : public Module, public Whois::EventListener, public return MOD_RES_PASSTHRU; } - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { - return ((numeric == 319) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU; + return ((numeric.GetNumeric() == 319) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU; } }; diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index ac02908c4..6a29d3bde 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -162,10 +162,10 @@ class ModuleSSLInfo : public Module, public Whois::EventListener ssl_cert* cert = cmd.CertExt.get(whois.GetTarget()); if (cert) { - whois.SendLine(671, ":is using a secure connection"); + whois.SendLine(671, "is using a secure connection"); bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly"); if ((!operonlyfp || whois.IsSelfWhois() || whois.GetSource()->IsOper()) && !cert->fingerprint.empty()) - whois.SendLine(276, ":has client certificate fingerprint %s", cert->fingerprint.c_str()); + whois.SendLine(276, InspIRCd::Format("has client certificate fingerprint %s", cert->fingerprint.c_str())); } } diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 46d96a952..9a433e154 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -93,16 +93,16 @@ class ModuleSWhois : public Module, public Whois::LineEventListener } // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games. - ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE + ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { /* We use this and not OnWhois because this triggers for remote, too */ - if (numeric == 312) + if (numeric.GetNumeric() == 312) { /* Insert our numeric before 312 */ std::string* swhois = cmd.swhois.get(whois.GetTarget()); if (swhois) { - whois.SendLine(320, ":%s", swhois->c_str()); + whois.SendLine(320, *swhois); } } |
