RPL_ENDMAP = 17, // ircu
RPL_MAPUSERS = 18, // insp-specific
- RPL_YOURUUID = 42, // taken from ircnet
-
RPL_UMODEIS = 221,
RPL_RULES = 232, // unrealircd
if (ServerInstance->Modules->Unload(m))
{
ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0].c_str(), user->nick.c_str());
- user->WriteRemoteNumeric(973, parameters[0], "Module successfully unloaded.");
+ user->WriteRemoteNumeric(RPL_UNLOADEDMODULE, parameters[0], "Module successfully unloaded.");
}
else
{
* 988 <nick> <servername> :Closed for new connections
* 989 <nick> <servername> :Open for new connections
*/
+enum
+{
+ // InspIRCd-specific.
+ RPL_SERVLOCKON = 988,
+ RPL_SERVLOCKOFF = 989
+};
class CommandLockserv : public Command
{
}
locked = parameters.empty() ? "Server is temporarily closed. Please try again later." : parameters[0];
- user->WriteNumeric(988, user->server->GetName(), "Closed for new connections");
+ user->WriteNumeric(RPL_SERVLOCKON, user->server->GetName(), "Closed for new connections");
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily disallow new connections", user->nick.c_str());
return CMD_SUCCESS;
}
}
locked.clear();
- user->WriteNumeric(989, user->server->GetName(), "Open for new connections");
+ user->WriteNumeric(RPL_SERVLOCKOFF, user->server->GetName(), "Open for new connections");
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow new connections", user->nick.c_str());
return CMD_SUCCESS;
}
#include "inspircd.h"
+enum
+{
+ // From Charybdis.
+ ERR_MLOCKRESTRICTED = 742
+};
+
class ModuleMLock : public Module
{
StringExtItem mlock;
std::string::size_type p = mlock_str->find(mode);
if (p != std::string::npos)
{
- source->WriteNumeric(742, channel->name, mode, *mlock_str, "MODE cannot be set due to channel having an active MLOCK restriction policy");
+ source->WriteNumeric(ERR_MLOCKRESTRICTED, channel->name, mode, *mlock_str, "MODE cannot be set due to channel having an active MLOCK restriction policy");
return MOD_RES_DENY;
}
#include "inspircd.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_NICKNOTLOCKED = 946,
+ RPL_NICKLOCKON = 947,
+ RPL_NICKLOCKOFF = 945
+};
+
/** Handle /NICKLOCK
*/
class CommandNicklock : public Command
return CMD_FAILURE;
}
- user->WriteNumeric(947, parameters[1], "Nickname now locked.");
+ user->WriteNumeric(RPL_NICKLOCKON, parameters[1], "Nickname now locked.");
}
/* If we made it this far, extend the user */
if (locked.set(target, 0))
{
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKUNLOCK on "+target->nick);
- user->WriteRemoteNumeric(945, target->nick, "Nickname now unlocked.");
+ user->WriteRemoteNumeric(RPL_NICKLOCKOFF, target->nick, "Nickname now unlocked.");
}
else
{
- user->WriteRemoteNumeric(946, target->nick, "This user's nickname is not locked.");
+ user->WriteRemoteNumeric(ERR_NICKNOTLOCKED, target->nick, "This user's nickname is not locked.");
return CMD_FAILURE;
}
}
return;
}
- user->WriteRemoteNumeric(375, "- IRC Operators Message of the Day");
+ user->WriteRemoteNumeric(RPL_MOTDSTART, "- IRC Operators Message of the Day");
for (file_cache::const_iterator i = opermotd.begin(); i != opermotd.end(); ++i)
{
- user->WriteRemoteNumeric(372, InspIRCd::Format("- %s", i->c_str()));
+ user->WriteRemoteNumeric(RPL_MOTD, InspIRCd::Format("- %s", i->c_str()));
}
- user->WriteRemoteNumeric(376, "- End of OPERMOTD");
+ user->WriteRemoteNumeric(RPL_ENDOFMOTD, "- End of OPERMOTD");
}
};
#include "modules/ssl.h"
#include "modules/spanningtree.h"
+enum
+{
+ // From IRCv3 sasl-3.1
+ RPL_SASLSUCCESS = 903,
+ ERR_SASLFAIL = 904,
+ ERR_SASLABORTED = 906,
+ RPL_SASLMECHS = 908
+};
+
static std::string sasl_target;
class ServerTracker : public SpanningTreeEventListener
this->result = this->GetSaslResult(msg[3]);
}
else if (msg[2] == "M")
- this->user->WriteNumeric(908, msg[3], "are available SASL mechanisms");
+ this->user->WriteNumeric(RPL_SASLMECHS, msg[3], "are available SASL mechanisms");
else
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Services sent an unknown SASL message \"%s\" \"%s\"", msg[2].c_str(), msg[3].c_str());
switch (this->result)
{
case SASL_OK:
- this->user->WriteNumeric(903, "SASL authentication successful");
+ this->user->WriteNumeric(RPL_SASLSUCCESS, "SASL authentication successful");
break;
case SASL_ABORT:
- this->user->WriteNumeric(906, "SASL authentication aborted");
+ this->user->WriteNumeric(ERR_SASLABORTED, "SASL authentication aborted");
break;
case SASL_FAIL:
- this->user->WriteNumeric(904, "SASL authentication failed");
+ this->user->WriteNumeric(ERR_SASLFAIL, "SASL authentication failed");
break;
default:
break;
#include "inspircd.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_INVALIDIDLETIME = 948,
+ RPL_IDLETIMESET = 944
+};
+
/** Handle /SETIDLE
*/
class CommandSetidle : public SplitCommand
int idle = InspIRCd::Duration(parameters[0]);
if (idle < 1)
{
- user->WriteNumeric(948, "Invalid idle time.");
+ user->WriteNumeric(ERR_INVALIDIDLETIME, "Invalid idle time.");
return CMD_FAILURE;
}
user->idle_lastmsg = (ServerInstance->Time() - idle);
if (user->signon > user->idle_lastmsg)
user->signon = user->idle_lastmsg;
ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds");
- user->WriteNumeric(944, "Idle time set.");
+ user->WriteNumeric(RPL_IDLETIMESET, "Idle time set.");
return CMD_SUCCESS;
}
#include "inspircd.h"
#include "modules/ssl.h"
+enum
+{
+ // From UnrealIRCd.
+ ERR_SECUREONLYCHAN = 489
+};
+
/** Handle channel mode +z
*/
class SSLMode : public ModeHandler
else
{
// Deny
- user->WriteNumeric(489, cname, "Cannot join channel; SSL users only (+z)");
+ user->WriteNumeric(ERR_SECUREONLYCHAN, cname, "Cannot join channel; SSL users only (+z)");
return MOD_RES_DENY;
}
}
#include "inspircd.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_TOPICLOCK = 744
+};
+
class CommandSVSTOPIC : public Command
{
public:
// Only fired for local users currently, but added a check anyway
if ((IS_LOCAL(user)) && (topiclock.get(chan)))
{
- user->WriteNumeric(744, chan->name, "TOPIC cannot be changed due to topic lock being active on the channel");
+ user->WriteNumeric(ERR_TOPICLOCK, chan->name, "TOPIC cannot be changed due to topic lock being active on the channel");
return MOD_RES_DENY;
}