aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-06-26 15:20:06 +0100
committerGravatar Sadie Powell2022-06-26 15:29:29 +0100
commit89712e2e84af1230232985c680846208a932d72b (patch)
treee6c43c55013a7b40e6f62c7d2410cd7790a9863a /src
parentMerge branch 'insp3' into master. (diff)
Move numerics to the source files where they are actually used.
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp6
-rw-r--r--src/commands.cpp10
-rw-r--r--src/coremods/core_channel/cmd_invite.cpp4
-rw-r--r--src/coremods/core_channel/cmd_kick.cpp6
-rw-r--r--src/coremods/core_channel/cmd_names.cpp7
-rw-r--r--src/coremods/core_channel/cmd_topic.cpp10
-rw-r--r--src/coremods/core_channel/cmode_k.cpp6
-rw-r--r--src/coremods/core_channel/core_channel.cpp8
-rw-r--r--src/coremods/core_channel/core_channel.h8
-rw-r--r--src/coremods/core_channel/modes.cpp7
-rw-r--r--src/coremods/core_info/cmd_admin.cpp9
-rw-r--r--src/coremods/core_info/cmd_info.cpp7
-rw-r--r--src/coremods/core_info/cmd_motd.cpp9
-rw-r--r--src/coremods/core_info/cmd_time.cpp6
-rw-r--r--src/coremods/core_lusers.cpp13
-rw-r--r--src/coremods/core_mode.cpp18
-rw-r--r--src/coremods/core_oper/cmd_rehash.cpp6
-rw-r--r--src/coremods/core_user/cmd_ison.cpp6
-rw-r--r--src/coremods/core_user/cmd_nick.cpp6
-rw-r--r--src/coremods/core_user/cmd_userhost.cpp6
-rw-r--r--src/coremods/core_user/core_user.cpp6
-rw-r--r--src/coremods/core_user/core_user.h2
-rw-r--r--src/coremods/core_whowas.cpp1
-rw-r--r--src/listmode.cpp7
-rw-r--r--src/modules/m_userip.cpp6
-rw-r--r--src/users.cpp10
26 files changed, 181 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index d4b488862..a2cd6a353 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -28,6 +28,12 @@
#include "inspircd.h"
#include "listmode.h"
+enum
+{
+ // From RFC 1459.
+ ERR_TOOMANYCHANNELS = 405,
+};
+
namespace
{
ChanModeReference ban(NULL, "ban");
diff --git a/src/commands.cpp b/src/commands.cpp
index 533fa6e5f..1d6fdb299 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -24,6 +24,16 @@
#include "inspircd.h"
+enum
+{
+ // From RFC 1459.
+ ERR_NOTREGISTERED = 451,
+ ERR_NEEDMOREPARAMS = 461,
+
+ // InspIRCd-specific.
+ RPL_SYNTAX = 650,
+};
+
CommandBase::CommandBase(Module* mod, const std::string& cmd, unsigned int minpara, unsigned int maxpara)
: ServiceProvider(mod, cmd, SERVICE_COMMAND)
, min_params(minpara)
diff --git a/src/coremods/core_channel/cmd_invite.cpp b/src/coremods/core_channel/cmd_invite.cpp
index 88b16e391..9e15f88b3 100644
--- a/src/coremods/core_channel/cmd_invite.cpp
+++ b/src/coremods/core_channel/cmd_invite.cpp
@@ -33,6 +33,10 @@
enum
{
+ // From RFC 1459.
+ RPL_INVITING = 341,
+ ERR_USERONCHANNEL = 443,
+
// From ircd-hybrid.
RPL_INVITELIST = 336,
RPL_ENDOFINVITELIST = 337
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp
index 3e6447225..39bac0a3e 100644
--- a/src/coremods/core_channel/cmd_kick.cpp
+++ b/src/coremods/core_channel/cmd_kick.cpp
@@ -29,6 +29,12 @@
#include "inspircd.h"
#include "core_channel.h"
+enum
+{
+ // From RFC 1459.
+ ERR_USERNOTINCHANNEL = 441,
+};
+
CommandKick::CommandKick(Module* parent)
: Command(parent, "KICK", 2, 3)
{
diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp
index 5d7159cda..3e16c7cd6 100644
--- a/src/coremods/core_channel/cmd_names.cpp
+++ b/src/coremods/core_channel/cmd_names.cpp
@@ -30,6 +30,13 @@
#include "core_channel.h"
#include "modules/names.h"
+enum
+{
+ // From RFC 1459.
+ RPL_NAMREPLY = 353,
+ RPL_ENDOFNAMES = 366,
+};
+
CommandNames::CommandNames(Module* parent)
: SplitCommand(parent, "NAMES", 0, 0)
, secretmode(parent, "secret")
diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp
index 6119bbd0b..abb7c1afb 100644
--- a/src/coremods/core_channel/cmd_topic.cpp
+++ b/src/coremods/core_channel/cmd_topic.cpp
@@ -28,6 +28,16 @@
#include "inspircd.h"
#include "core_channel.h"
+enum
+{
+ // From RFC 1459.
+ RPL_NOTOPICSET = 331,
+ RPL_TOPIC = 332,
+
+ // From ircu.
+ RPL_TOPICTIME = 333,
+};
+
CommandTopic::CommandTopic(Module* parent)
: SplitCommand(parent, "TOPIC", 1, 2)
, exemptionprov(parent)
diff --git a/src/coremods/core_channel/cmode_k.cpp b/src/coremods/core_channel/cmode_k.cpp
index 54c519b4e..437a4bf50 100644
--- a/src/coremods/core_channel/cmode_k.cpp
+++ b/src/coremods/core_channel/cmode_k.cpp
@@ -27,6 +27,12 @@
#include "inspircd.h"
#include "core_channel.h"
+enum
+{
+ // From RFC 1459.
+ ERR_KEYSET = 467,
+};
+
ModeChannelKey::ModeChannelKey(Module* Creator)
: ParamMode<ModeChannelKey, StringExtItem>(Creator, "key", 'k', PARAM_ALWAYS)
{
diff --git a/src/coremods/core_channel/core_channel.cpp b/src/coremods/core_channel/core_channel.cpp
index 7855cab6b..5d6d23b33 100644
--- a/src/coremods/core_channel/core_channel.cpp
+++ b/src/coremods/core_channel/core_channel.cpp
@@ -27,6 +27,14 @@
#include "listmode.h"
#include "modules/isupport.h"
+enum
+{
+ // From RFC 1459.
+ ERR_CHANNELISFULL = 471,
+ ERR_INVITEONLYCHAN = 473,
+ ERR_BADCHANNELKEY = 475,
+};
+
namespace
{
/** Hook that sends a MODE after a JOIN if the user in the JOIN has some modes prefix set.
diff --git a/src/coremods/core_channel/core_channel.h b/src/coremods/core_channel/core_channel.h
index 2d71e18b5..caa4adf99 100644
--- a/src/coremods/core_channel/core_channel.h
+++ b/src/coremods/core_channel/core_channel.h
@@ -35,14 +35,6 @@ namespace Invite
class APIImpl;
}
-enum
-{
- // From RFC 1459.
- RPL_BANLIST = 367,
- RPL_ENDOFBANLIST = 368,
- ERR_KEYSET = 467
-};
-
class CommandInvite final
: public Command
{
diff --git a/src/coremods/core_channel/modes.cpp b/src/coremods/core_channel/modes.cpp
index d8afc1261..e0a1ee261 100644
--- a/src/coremods/core_channel/modes.cpp
+++ b/src/coremods/core_channel/modes.cpp
@@ -20,6 +20,13 @@
#include "inspircd.h"
#include "core_channel.h"
+enum
+{
+ // From RFC 1459.
+ RPL_BANLIST = 367,
+ RPL_ENDOFBANLIST = 368,
+};
+
ModeChannelBan::ModeChannelBan(Module* Creator)
: ListModeBase(Creator, "ban", 'b', RPL_BANLIST, RPL_ENDOFBANLIST)
, extbanmgr(Creator)
diff --git a/src/coremods/core_info/cmd_admin.cpp b/src/coremods/core_info/cmd_admin.cpp
index ae47f71ee..955f83075 100644
--- a/src/coremods/core_info/cmd_admin.cpp
+++ b/src/coremods/core_info/cmd_admin.cpp
@@ -26,6 +26,15 @@
#include "inspircd.h"
#include "core_info.h"
+enum
+{
+ // From RFC 1459.
+ RPL_ADMINME = 256,
+ RPL_ADMINLOC1 = 257,
+ RPL_ADMINLOC2 = 258,
+ RPL_ADMINEMAIL = 259,
+};
+
CommandAdmin::CommandAdmin(Module* parent)
: ServerTargetCommand(parent, "ADMIN")
{
diff --git a/src/coremods/core_info/cmd_info.cpp b/src/coremods/core_info/cmd_info.cpp
index 1e2ca6ce0..3478f5fa4 100644
--- a/src/coremods/core_info/cmd_info.cpp
+++ b/src/coremods/core_info/cmd_info.cpp
@@ -26,6 +26,13 @@
#include "inspircd.h"
#include "core_info.h"
+enum
+{
+ // From RFC 1459
+ RPL_INFO = 371,
+ RPL_ENDOFINFO = 374,
+};
+
CommandInfo::CommandInfo(Module* parent)
: SplitCommand(parent, "INFO")
{
diff --git a/src/coremods/core_info/cmd_motd.cpp b/src/coremods/core_info/cmd_motd.cpp
index 7a99f9fdb..7ce5419f1 100644
--- a/src/coremods/core_info/cmd_motd.cpp
+++ b/src/coremods/core_info/cmd_motd.cpp
@@ -25,6 +25,15 @@
#include "inspircd.h"
#include "core_info.h"
+enum
+{
+ // From RFC 1459
+ RPL_MOTD = 372,
+ RPL_MOTDSTART = 375,
+ RPL_ENDOFMOTD = 376,
+ ERR_NOMOTD = 422,
+};
+
CommandMotd::CommandMotd(Module* parent)
: ServerTargetCommand(parent, "MOTD")
{
diff --git a/src/coremods/core_info/cmd_time.cpp b/src/coremods/core_info/cmd_time.cpp
index 941151781..9713d4ef9 100644
--- a/src/coremods/core_info/cmd_time.cpp
+++ b/src/coremods/core_info/cmd_time.cpp
@@ -26,6 +26,12 @@
#include "inspircd.h"
#include "core_info.h"
+enum
+{
+ // From RFC 1459.
+ RPL_TIME = 391,
+};
+
CommandTime::CommandTime(Module* parent)
: ServerTargetCommand(parent, "TIME")
{
diff --git a/src/coremods/core_lusers.cpp b/src/coremods/core_lusers.cpp
index d54e2427e..7f98b600f 100644
--- a/src/coremods/core_lusers.cpp
+++ b/src/coremods/core_lusers.cpp
@@ -26,6 +26,19 @@
#include "inspircd.h"
+enum
+{
+ // From RFC 1459.
+ RPL_LUSERCLIENT = 251,
+ RPL_LUSERUNKNOWN = 253,
+ RPL_LUSERCHANNELS = 254,
+ RPL_LUSERME = 255,
+
+ // From ircd-ratbox?
+ RPL_LOCALUSERS = 265,
+ RPL_GLOBALUSERS = 266,
+};
+
struct LusersCounters final
{
size_t max_local;
diff --git a/src/coremods/core_mode.cpp b/src/coremods/core_mode.cpp
index fb947f47f..644c30eb5 100644
--- a/src/coremods/core_mode.cpp
+++ b/src/coremods/core_mode.cpp
@@ -24,6 +24,24 @@
#include "inspircd.h"
#include "modules/isupport.h"
+enum
+{
+ // From RFC 1459.
+ RPL_UMODEIS = 221,
+ RPL_CHANNELMODEIS = 324,
+ ERR_USERSDONTMATCH = 502,
+
+ // From ircu?
+ RPL_CHANNELCREATED = 329,
+
+ // From UnrealIRCd.
+ RPL_SNOMASKIS = 8,
+
+ // InspIRCd-specific.
+ RPL_OTHERUMODEIS = 803,
+ RPL_OTHERSNOMASKIS = 804,
+};
+
class CommandMode final
: public Command
{
diff --git a/src/coremods/core_oper/cmd_rehash.cpp b/src/coremods/core_oper/cmd_rehash.cpp
index 4641b2a23..7242d4b85 100644
--- a/src/coremods/core_oper/cmd_rehash.cpp
+++ b/src/coremods/core_oper/cmd_rehash.cpp
@@ -30,6 +30,12 @@
#include "inspircd.h"
#include "core_oper.h"
+enum
+{
+ // From RFC 1459.
+ RPL_REHASHING = 382,
+};
+
CommandRehash::CommandRehash(Module* parent)
: Command(parent, "REHASH", 0)
{
diff --git a/src/coremods/core_user/cmd_ison.cpp b/src/coremods/core_user/cmd_ison.cpp
index 77f0df5bc..2779fa14f 100644
--- a/src/coremods/core_user/cmd_ison.cpp
+++ b/src/coremods/core_user/cmd_ison.cpp
@@ -25,6 +25,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From RFC 1459.
+ RPL_ISON = 303,
+};
+
class IsonReplyBuilder final
: public Numeric::Builder<' ', true>
{
diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp
index 7670f8bd6..5cfd60018 100644
--- a/src/coremods/core_user/cmd_nick.cpp
+++ b/src/coremods/core_user/cmd_nick.cpp
@@ -28,6 +28,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From RFC 1459.
+ ERR_NONICKNAMEGIVEN = 431,
+};
+
CommandNick::CommandNick(Module* parent)
: SplitCommand(parent, "NICK", 1)
{
diff --git a/src/coremods/core_user/cmd_userhost.cpp b/src/coremods/core_user/cmd_userhost.cpp
index 71ee2a088..9ae0fd3c2 100644
--- a/src/coremods/core_user/cmd_userhost.cpp
+++ b/src/coremods/core_user/cmd_userhost.cpp
@@ -26,6 +26,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From RFC 1459.
+ RPL_USERHOST = 302,
+};
+
CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
{
const bool has_privs = user->HasPrivPermission("users/auspex");
diff --git a/src/coremods/core_user/core_user.cpp b/src/coremods/core_user/core_user.cpp
index 71a082ff3..9875366a1 100644
--- a/src/coremods/core_user/core_user.cpp
+++ b/src/coremods/core_user/core_user.cpp
@@ -21,6 +21,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From RFC 1459.
+ ERR_NOORIGIN = 409,
+};
+
class CommandPass final
: public SplitCommand
{
diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h
index 11c188480..5997bafa1 100644
--- a/src/coremods/core_user/core_user.h
+++ b/src/coremods/core_user/core_user.h
@@ -27,7 +27,7 @@
enum
{
// From RFC 1459.
- ERR_NOORIGIN = 409
+ ERR_ALREADYREGISTERED = 462,
};
class MessageWrapper final
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp
index a87186410..0fbc65ff6 100644
--- a/src/coremods/core_whowas.cpp
+++ b/src/coremods/core_whowas.cpp
@@ -34,6 +34,7 @@ enum
// From RFC 1459.
RPL_WHOWASUSER = 314,
RPL_ENDOFWHOWAS = 369,
+ ERR_WASNOSUCHNICK = 406,
// InspIRCd-specific.
RPL_WHOWASIP = 652
diff --git a/src/listmode.cpp b/src/listmode.cpp
index 9956ded25..3ef60f095 100644
--- a/src/listmode.cpp
+++ b/src/listmode.cpp
@@ -22,6 +22,13 @@
#include "inspircd.h"
#include "listmode.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_LISTMODEALREADYSET = 697,
+ ERR_LISTMODENOTSET = 698,
+};
+
ListModeBase::ListModeBase(Module* Creator, const std::string& Name, char modechar, unsigned int lnum, unsigned int eolnum)
: ModeHandler(Creator, Name, modechar, PARAM_ALWAYS, MODETYPE_CHANNEL, MC_LIST)
, listnumeric(lnum)
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index f81ffe6c7..23ce513c3 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -27,6 +27,12 @@
#include "inspircd.h"
#include "modules/isupport.h"
+enum
+{
+ // From UnrealIRCd.
+ RPL_USERIP = 340,
+};
+
class CommandUserip final
: public Command
{
diff --git a/src/users.cpp b/src/users.cpp
index 5ce55b51c..94ecf72da 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -37,6 +37,16 @@
#include "inspircd.h"
#include "xline.h"
+enum
+{
+ // From RFC 1459.
+ RPL_YOUAREOPER = 381,
+ ERR_NICKNAMEINUSE = 433,
+
+ // From ircu.
+ RPL_YOURDISPLAYEDHOST = 396,
+};
+
ClientProtocol::MessageList LocalUser::sendmsglist;
bool User::IsNoticeMaskSet(unsigned char sm)