aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-07-05 16:43:33 +0100
committerGravatar Sadie Powell2021-07-05 16:50:14 +0100
commit38351efa8d3f17ad9a46f332783fbe0fd663f0cf (patch)
treea1cc47e8a72d5c247d6aeb61a0f433c14efb13a7 /src/modules
parentDon't send oper swhois to users with hideoper enabled. (diff)
Deduplicate all whois numerics to the whois module header.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_botmode.cpp6
-rw-r--r--src/modules/m_cgiirc.cpp6
-rw-r--r--src/modules/m_customtitle.cpp8
-rw-r--r--src/modules/m_geoban.cpp6
-rw-r--r--src/modules/m_helpop.cpp3
-rw-r--r--src/modules/m_hideoper.cpp2
-rw-r--r--src/modules/m_services_account.cpp6
-rw-r--r--src/modules/m_servprotect.cpp2
-rw-r--r--src/modules/m_spanningtree/override_whois.cpp1
-rw-r--r--src/modules/m_sslinfo.cpp9
-rw-r--r--src/modules/m_swhois.cpp8
11 files changed, 4 insertions, 53 deletions
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp
index a31d51d3d..1ef6663f9 100644
--- a/src/modules/m_botmode.cpp
+++ b/src/modules/m_botmode.cpp
@@ -28,12 +28,6 @@
#include "modules/who.h"
#include "modules/whois.h"
-enum
-{
- // From UnrealIRCd.
- RPL_WHOISBOT = 335
-};
-
class BotTag : public ClientProtocol::MessageTagProvider
{
private:
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index f0963e4c1..37609bec0 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -33,12 +33,6 @@
#include "modules/webirc.h"
#include "modules/whois.h"
-enum
-{
- // InspIRCd-specific.
- RPL_WHOISGATEWAY = 350
-};
-
// One or more hostmask globs or CIDR ranges.
typedef std::vector<std::string> MaskList;
diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp
index faac3045a..fc6d57d80 100644
--- a/src/modules/m_customtitle.cpp
+++ b/src/modules/m_customtitle.cpp
@@ -27,12 +27,6 @@
#include "inspircd.h"
#include "modules/whois.h"
-enum
-{
- // From UnrealIRCd.
- RPL_WHOISSPECIAL = 320
-};
-
struct CustomTitle
{
const std::string name;
@@ -156,7 +150,7 @@ class ModuleCustomTitle : public Module, public Whois::LineEventListener
ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE
{
/* We use this and not OnWhois because this triggers for remote, too */
- if (numeric.GetNumeric() == 312)
+ if (numeric.GetNumeric() == RPL_WHOISSERVER)
{
/* Insert our numeric before 312 */
const std::string* ctitle = cmd.ctitle.get(whois.GetTarget());
diff --git a/src/modules/m_geoban.cpp b/src/modules/m_geoban.cpp
index 63f7de6ac..4b2b3ff87 100644
--- a/src/modules/m_geoban.cpp
+++ b/src/modules/m_geoban.cpp
@@ -22,12 +22,6 @@
#include "modules/geolocation.h"
#include "modules/whois.h"
-enum
-{
- // InspIRCd-specific.
- RPL_WHOISCOUNTRY = 344
-};
-
class ModuleGeoBan
: public Module
, public Whois::EventListener
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index f1f26a5ee..594f4a8d4 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -29,9 +29,6 @@
enum
{
- // From UnrealIRCd.
- RPL_WHOISHELPOP = 310,
-
// From ircd-ratbox.
ERR_HELPNOTFOUND = 524,
RPL_HELPSTART = 704,
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index 888f9ad5f..cca0b4da4 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -110,7 +110,7 @@ class ModuleHideOper
/* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the
* person doing the WHOIS is not an oper
*/
- if (numeric.GetNumeric() != 313)
+ if (numeric.GetNumeric() != RPL_WHOISOPERATOR)
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 44e121cfd..306f25ea9 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -35,12 +35,6 @@
enum
{
- // From UnrealIRCd.
- RPL_WHOISREGNICK = 307,
-
- // From ircu.
- RPL_WHOISACCOUNT = 330,
-
// From ircd-hybrid?
ERR_NEEDREGGEDNICK = 477,
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 98b5983f6..ad7d924b4 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -129,7 +129,7 @@ class ModuleServProtectMode CXX11_FINAL
ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE
{
- return ((numeric.GetNumeric() == 319) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
+ return ((numeric.GetNumeric() == RPL_WHOISCHANNELS) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
}
};
diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp
index 01246f22d..4547f9130 100644
--- a/src/modules/m_spanningtree/override_whois.cpp
+++ b/src/modules/m_spanningtree/override_whois.cpp
@@ -22,6 +22,7 @@
*/
#include "inspircd.h"
+#include "modules/whois.h"
#include "main.h"
#include "commandbuilder.h"
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index 28ba3f177..6062bd473 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -31,15 +31,6 @@
#include "modules/whois.h"
#include "modules/who.h"
-enum
-{
- // From oftc-hybrid.
- RPL_WHOISCERTFP = 276,
-
- // From UnrealIRCd.
- RPL_WHOISSECURE = 671
-};
-
class SSLCertExt : public ExtensionItem
{
public:
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index 691e0a3a8..da45769fd 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -27,14 +27,6 @@
#include "inspircd.h"
#include "modules/whois.h"
-enum
-{
- // From UnrealIRCd.
- RPL_WHOISSPECIAL = 320
-};
-
-/** Handle /SWHOIS
- */
class CommandSwhois : public Command
{
public: