From c2376ac6f49ab01794a21a3e9bb7c1b3c5a1c2d8 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 27 Jan 2018 12:24:47 +0000 Subject: Add names for a bunch of numerics. --- src/modules/m_abbreviation.cpp | 10 +++++++-- src/modules/m_chanfilter.cpp | 14 ++++++++++--- src/modules/m_dccallow.cpp | 46 +++++++++++++++++++++++++++++------------- src/modules/m_knock.cpp | 8 +++++++- src/modules/m_namedmodes.cpp | 11 ++++++++-- src/modules/m_servprotect.cpp | 7 +++++-- src/modules/m_silence.cpp | 25 ++++++++++++++++------- src/modules/m_sslinfo.cpp | 4 ++-- src/modules/m_uninvite.cpp | 8 +++++++- src/modules/m_watch.cpp | 5 +++-- 10 files changed, 102 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp index 2a38bd3a6..c81caf142 100644 --- a/src/modules/m_abbreviation.cpp +++ b/src/modules/m_abbreviation.cpp @@ -19,6 +19,12 @@ #include "inspircd.h" +enum +{ + // InspIRCd-specific. + ERR_AMBIGUOUSCOMMAND = 420 +}; + class ModuleAbbreviation : public Module { public: @@ -49,7 +55,7 @@ class ModuleAbbreviation : public Module { if (matchlist.length() > 450) { - user->WriteNumeric(420, "Ambiguous abbreviation and too many possible matches."); + user->WriteNumeric(ERR_AMBIGUOUSCOMMAND, "Ambiguous abbreviation and too many possible matches."); return MOD_RES_DENY; } @@ -67,7 +73,7 @@ class ModuleAbbreviation : public Module /* Ambiguous command, list the matches */ if (!matchlist.empty()) { - user->WriteNumeric(420, InspIRCd::Format("Ambiguous abbreviation, possible matches: %s%s", foundcommand.c_str(), matchlist.c_str())); + user->WriteNumeric(ERR_AMBIGUOUSCOMMAND, InspIRCd::Format("Ambiguous abbreviation, possible matches: %s%s", foundcommand.c_str(), matchlist.c_str())); return MOD_RES_DENY; } diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index d201f5418..70535a475 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -27,6 +27,14 @@ #include "listmode.h" #include "modules/exemption.h" +enum +{ + // InspIRCd-specific. + ERR_ALREADYCHANFILTERED = 937, + ERR_NOSUCHCHANFILTER = 938, + ERR_CHANFILTERFULL = 939 +}; + /** Handles channel mode +g */ class ChanFilter : public ListModeBase @@ -46,17 +54,17 @@ class ChanFilter : public ListModeBase void TellListTooLong(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { - user->WriteNumeric(939, chan->name, word, "Channel spamfilter list is full"); + user->WriteNumeric(ERR_CHANFILTERFULL, chan->name, word, "Channel spamfilter list is full"); } void TellAlreadyOnList(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { - user->WriteNumeric(937, chan->name, InspIRCd::Format("The word %s is already on the spamfilter list", word.c_str())); + user->WriteNumeric(ERR_ALREADYCHANFILTERED, chan->name, InspIRCd::Format("The word %s is already on the spamfilter list", word.c_str())); } void TellNotSet(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { - user->WriteNumeric(938, chan->name, "No such spamfilter word is set"); + user->WriteNumeric(ERR_NOSUCHCHANFILTER, chan->name, "No such spamfilter word is set"); } }; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 65eeeba11..0e6188339 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -25,6 +25,24 @@ #include "inspircd.h" +enum +{ + // InspIRCd-specific? + RPL_DCCALLOWSTART = 990, + RPL_DCCALLOWLIST = 991, + RPL_DCCALLOWEND = 992, + RPL_DCCALLOWTIMED = 993, + RPL_DCCALLOWPERMANENT = 994, + RPL_DCCALLOWREMOVED = 995, + ERR_DCCALLOWINVALID = 996, + RPL_DCCALLOWEXPIRED = 997, + ERR_UNKNOWNDCCALLOWCMD = 998, + // TODO: These numerics are conflicting and should be removed + // and be replaced with helpop. + RPL_DCCALLOWHELP = 998, + RPL_ENDOFDCCALLOWHELP = 999 +}; + static const char* const helptext[] = { "DCCALLOW [(+|-) [