From e8da9b7a266c545844bfb4a3987b7fc0b05f2cf7 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 9 Dec 2017 13:43:44 +0000 Subject: [PATCH] Add names for a bunch more numerics. --- src/modules/m_botmode.cpp | 8 +++++++- src/modules/m_customtitle.cpp | 8 +++++++- src/modules/m_helpop.cpp | 8 +++++++- src/modules/m_services_account.cpp | 10 ++++++++-- src/modules/m_servprotect.cpp | 8 +++++++- src/modules/m_sslinfo.cpp | 13 +++++++++++-- src/modules/m_swhois.cpp | 8 +++++++- 7 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index b5befe9fa..487bc140b 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -21,6 +21,12 @@ #include "inspircd.h" +enum +{ + // From UnrealIRCd. + RPL_WHOISBOT = 335, +}; + class ModuleBotMode : public Module, public Whois::EventListener { SimpleUserModeHandler bm; @@ -40,7 +46,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(RPL_WHOISBOT, "is a bot on " + ServerInstance->Config->Network); } } }; diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 16d1ae738..76d37b9d9 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -21,6 +21,12 @@ #include "inspircd.h" +enum +{ + // From UnrealIRCd. + RPL_WHOISSPECIAL = 320 +}; + /** Handle /TITLE */ class CommandTitle : public Command @@ -91,7 +97,7 @@ class ModuleCustomTitle : public Module, public Whois::LineEventListener const std::string* ctitle = cmd.ctitle.get(whois.GetTarget()); if (ctitle) { - whois.SendLine(320, ctitle); + whois.SendLine(RPL_WHOISSPECIAL, ctitle); } } /* Don't block anything */ diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index ecab97ca2..b8c5d3029 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -23,6 +23,12 @@ #include "inspircd.h" +enum +{ + // From UnrealIRCd. + RPL_WHOISHELPOP = 310 +}; + typedef std::map HelpopMap; static HelpopMap helpop_map; @@ -145,7 +151,7 @@ class ModuleHelpop : public Module, public Whois::EventListener { if (whois.GetTarget()->IsModeSet(ho)) { - whois.SendLine(310, "is available for help."); + whois.SendLine(RPL_WHOISHELPOP, "is available for help."); } } diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 2a5915f25..05cc2b416 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -28,6 +28,12 @@ enum { + // From UnrealIRCd. + RPL_WHOISREGNICK = 307, + + // From ircu. + RPL_WHOISACCOUNT = 330, + // From ircd-hybrid? ERR_NEEDREGGEDNICK = 477, @@ -165,13 +171,13 @@ class ModuleServicesAccount : public Module, public Whois::EventListener if (account) { - whois.SendLine(330, *account, "is logged in as"); + whois.SendLine(RPL_WHOISACCOUNT, *account, "is logged in as"); } if (whois.GetTarget()->IsModeSet(m5)) { /* user is registered */ - whois.SendLine(307, "is a registered nick"); + whois.SendLine(RPL_WHOISREGNICK, "is a registered nick"); } } diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index dae646576..1226b601a 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -21,6 +21,12 @@ #include "inspircd.h" +enum +{ + // From AustHex. + RPL_WHOISSERVICE = 310 +}; + /** Handles user mode +k */ class ServProtectMode : public ModeHandler @@ -62,7 +68,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(RPL_WHOISSERVICE, "is a Network Service on " + ServerInstance->Config->Network); } } diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index fc92bb17a..746ade2ac 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -20,6 +20,15 @@ #include "inspircd.h" #include "modules/ssl.h" +enum +{ + // From oftc-hybrid. + RPL_WHOISCERTFP = 276, + + // From UnrealIRCd. + RPL_WHOISSECURE = 671 +}; + class SSLCertExt : public ExtensionItem { public: SSLCertExt(Module* parent) @@ -162,10 +171,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(RPL_WHOISSECURE, "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, InspIRCd::Format("has client certificate fingerprint %s", cert->fingerprint.c_str())); + whois.SendLine(RPL_WHOISCERTFP, 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 5c2fb6011..d8c8a33bb 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -25,6 +25,12 @@ #include "inspircd.h" +enum +{ + // From UnrealIRCd. + RPL_WHOISSPECIAL = 320 +}; + /** Handle /SWHOIS */ class CommandSwhois : public Command @@ -102,7 +108,7 @@ class ModuleSWhois : public Module, public Whois::LineEventListener std::string* swhois = cmd.swhois.get(whois.GetTarget()); if (swhois) { - whois.SendLine(320, *swhois); + whois.SendLine(RPL_WHOISSPECIAL, *swhois); } } -- 2.39.5