* Module authors, please note!
* While you are free to use any numerics on this list, like the rest of the core, you
* *should not* be editing it!
- * You should just WriteNumeric(444, .. or whatever as you would before this file, OR:
- * #define RPL_MYNUMERIC 444 & WriteNumeric(RPL_MYNUMERIC, ...
*
* If you *do* have a suggestion for a numeric you genuinely believe would be useful,
* please speak to us. :)
#include "inspircd.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_AMBIGUOUSCOMMAND = 420
+};
+
class ModuleAbbreviation : public Module
{
public:
{
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;
}
/* 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;
}
#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
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");
}
};
#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 [(+|-)<nick> [<time>]]|[LIST|HELP]",
}
else
{
- user->WriteNumeric(998, "DCCALLOW command not understood. For help on DCCALLOW, type /DCCALLOW HELP");
+ user->WriteNumeric(ERR_UNKNOWNDCCALLOWCMD, "DCCALLOW command not understood. For help on DCCALLOW, type /DCCALLOW HELP");
return CMD_FAILURE;
}
}
if (i->nickname == target->nick)
{
dl->erase(i);
- user->WriteNumeric(995, user->nick, InspIRCd::Format("Removed %s from your DCCALLOW list", target->nick.c_str()));
+ user->WriteNumeric(RPL_DCCALLOWREMOVED, user->nick, InspIRCd::Format("Removed %s from your DCCALLOW list", target->nick.c_str()));
break;
}
}
{
if (target == user)
{
- user->WriteNumeric(996, user->nick, "You cannot add yourself to your own DCCALLOW list!");
+ user->WriteNumeric(ERR_DCCALLOWINVALID, user->nick, "You cannot add yourself to your own DCCALLOW list!");
return CMD_FAILURE;
}
if (dl->size() >= maxentries)
{
- user->WriteNumeric(996, user->nick, "Too many nicks on DCCALLOW list");
+ user->WriteNumeric(ERR_DCCALLOWINVALID, user->nick, "Too many nicks on DCCALLOW list");
return CMD_FAILURE;
}
{
if (k->nickname == target->nick)
{
- user->WriteNumeric(996, user->nick, InspIRCd::Format("%s is already on your DCCALLOW list", target->nick.c_str()));
+ user->WriteNumeric(ERR_DCCALLOWINVALID, user->nick, InspIRCd::Format("%s is already on your DCCALLOW list", target->nick.c_str()));
return CMD_FAILURE;
}
}
if (length > 0)
{
- user->WriteNumeric(993, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %ld seconds", target->nick.c_str(), length));
+ user->WriteNumeric(RPL_DCCALLOWTIMED, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %ld seconds", target->nick.c_str(), length));
}
else
{
- user->WriteNumeric(994, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for this session", target->nick.c_str()));
+ user->WriteNumeric(RPL_DCCALLOWPERMANENT, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for this session", target->nick.c_str()));
}
/* route it. */
void DisplayHelp(User* user)
{
for (size_t i = 0; i < sizeof(helptext)/sizeof(helptext[0]); i++)
- user->WriteNumeric(998, helptext[i]);
- user->WriteNumeric(999, "End of DCCALLOW HELP");
+ user->WriteNumeric(RPL_DCCALLOWHELP, helptext[i]);
+ user->WriteNumeric(RPL_ENDOFDCCALLOWHELP, "End of DCCALLOW HELP");
LocalUser* localuser = IS_LOCAL(user);
if (localuser)
void DisplayDCCAllowList(User* user)
{
// display current DCCALLOW list
- user->WriteNumeric(990, "Users on your DCCALLOW list:");
+ user->WriteNumeric(RPL_DCCALLOWSTART, "Users on your DCCALLOW list:");
dl = ext.get(user);
if (dl)
{
for (dccallowlist::const_iterator c = dl->begin(); c != dl->end(); ++c)
{
- user->WriteNumeric(991, user->nick, InspIRCd::Format("%s (%s)", c->nickname.c_str(), c->hostmask.c_str()));
+ user->WriteNumeric(RPL_DCCALLOWLIST, user->nick, InspIRCd::Format("%s (%s)", c->nickname.c_str(), c->hostmask.c_str()));
}
}
- user->WriteNumeric(992, "End of DCCALLOW list");
+ user->WriteNumeric(RPL_DCCALLOWEND, "End of DCCALLOW list");
}
};
time_t expires = iter2->set_on + iter2->length;
if (iter2->length != 0 && expires <= ServerInstance->Time())
{
- u->WriteNumeric(997, u->nick, InspIRCd::Format("DCCALLOW entry for %s has expired", iter2->nickname.c_str()));
+ u->WriteNumeric(RPL_DCCALLOWEXPIRED, u->nick, InspIRCd::Format("DCCALLOW entry for %s has expired", iter2->nickname.c_str()));
iter2 = dl->erase(iter2);
}
else
{
u->WriteNotice(i->nickname + " left the network or changed their nickname and has been removed from your DCCALLOW list");
- u->WriteNumeric(995, u->nick, InspIRCd::Format("Removed %s from your DCCALLOW list", i->nickname.c_str()));
+ u->WriteNumeric(RPL_DCCALLOWREMOVED, u->nick, InspIRCd::Format("Removed %s from your DCCALLOW list", i->nickname.c_str()));
dl->erase(i);
break;
}
#include "inspircd.h"
+enum
+{
+ // From UnrealIRCd.
+ ERR_CANNOTKNOCK = 480
+};
+
/** Handles the /KNOCK command
*/
class CommandKnock : public Command
if (c->IsModeSet(noknockmode))
{
- user->WriteNumeric(480, InspIRCd::Format("Can't KNOCK on %s, +K is set.", c->name.c_str()));
+ user->WriteNumeric(ERR_CANNOTKNOCK, InspIRCd::Format("Can't KNOCK on %s, +K is set.", c->name.c_str()));
return CMD_FAILURE;
}
#include "inspircd.h"
+enum
+{
+ // InspIRCd-specific.
+ RPL_ENDOFPROPLIST = 960,
+ RPL_PROPLIST = 961
+};
+
static void DisplayList(LocalUser* user, Channel* channel)
{
- Numeric::ParamBuilder<1> numeric(user, 961);
+ Numeric::ParamBuilder<1> numeric(user, RPL_PROPLIST);
numeric.AddStatic(channel->name);
const ModeParser::ModeHandlerMap& mhs = ServerInstance->Modes->GetModes(MODETYPE_CHANNEL);
}
}
numeric.Flush();
- user->WriteNumeric(960, channel->name, "End of mode list");
+ user->WriteNumeric(RPL_ENDOFPROPLIST, channel->name, "End of mode list");
}
class CommandProp : public SplitCommand
enum
{
// From AustHex.
- RPL_WHOISSERVICE = 310
+ RPL_WHOISSERVICE = 310,
+
+ // From UnrealIRCd.
+ ERR_KILLDENY = 485
};
/** Handles user mode +k
if (dst->IsModeSet(bm))
{
- src->WriteNumeric(485, InspIRCd::Format("You are not permitted to kill %s services!", ServerInstance->Config->Network.c_str()));
+ src->WriteNumeric(ERR_KILLDENY, InspIRCd::Format("You are not permitted to kill %s services!", ServerInstance->Config->Network.c_str()));
ServerInstance->SNO->WriteGlobalSno('a', src->nick+" tried to kill service "+dst->nick+" ("+reason+")");
return MOD_RES_DENY;
}
static int SILENCE_ALL = 0x0020; /* a all, (pcint) */
static int SILENCE_EXCLUDE = 0x0040; /* x exclude this pattern */
+enum
+{
+ // From ircu?
+ RPL_SILELIST = 271,
+ RPL_ENDOFSILELIST = 272,
+
+ // InspIRCd-specific.
+ RPL_UNSILENCED = 950,
+ RPL_SILENCED = 951,
+ ERR_NOTSILENCED = 952
+};
class CommandSVSSilence : public Command
{
for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
{
std::string decomppattern = DecompPattern(c->second);
- user->WriteNumeric(271, user->nick, c->first, decomppattern);
+ user->WriteNumeric(RPL_SILELIST, user->nick, c->first, decomppattern);
}
}
- user->WriteNumeric(272, "End of Silence List");
+ user->WriteNumeric(RPL_ENDOFSILELIST, "End of Silence List");
return CMD_SUCCESS;
}
if ((irc::equals(listitem, mask)) && (i->second == pattern))
{
sl->erase(i);
- user->WriteNumeric(950, user->nick, InspIRCd::Format("Removed %s %s from silence list", mask.c_str(), decomppattern.c_str()));
+ user->WriteNumeric(RPL_UNSILENCED, user->nick, InspIRCd::Format("Removed %s %s from silence list", mask.c_str(), decomppattern.c_str()));
if (!sl->size())
{
ext.unset(user);
}
}
}
- user->WriteNumeric(952, user->nick, InspIRCd::Format("%s %s does not exist on your silence list", mask.c_str(), decomppattern.c_str()));
+ user->WriteNumeric(ERR_NOTSILENCED, user->nick, InspIRCd::Format("%s %s does not exist on your silence list", mask.c_str(), decomppattern.c_str()));
}
else if (action == '+')
{
}
if (sl->size() > maxsilence)
{
- user->WriteNumeric(952, user->nick, "Your silence list is full");
+ user->WriteNumeric(ERR_NOTSILENCED, user->nick, "Your silence list is full");
return CMD_FAILURE;
}
const std::string& listitem = n->first;
if ((irc::equals(listitem, mask)) && (n->second == pattern))
{
- user->WriteNumeric(952, user->nick, InspIRCd::Format("%s %s is already on your silence list", mask.c_str(), decomppattern.c_str()));
+ user->WriteNumeric(ERR_NOTSILENCED, user->nick, InspIRCd::Format("%s %s is already on your silence list", mask.c_str(), decomppattern.c_str()));
return CMD_FAILURE;
}
}
{
sl->push_back(silenceset(mask,pattern));
}
- user->WriteNumeric(951, user->nick, InspIRCd::Format("Added %s %s to silence list", mask.c_str(), decomppattern.c_str()));
+ user->WriteNumeric(RPL_SILENCED, user->nick, InspIRCd::Format("Added %s %s to silence list", mask.c_str(), decomppattern.c_str()));
return CMD_SUCCESS;
}
}
if (ifo->oper_block->getBool("sslonly") && !cert)
{
- user->WriteNumeric(491, "This oper login requires an SSL connection.");
+ user->WriteNumeric(ERR_NOOPERHOST, "This oper login requires an SSL connection.");
user->CommandFloodPenalty += 10000;
return MOD_RES_DENY;
}
std::string fingerprint;
if (ifo->oper_block->readString("fingerprint", fingerprint) && (!cert || cert->GetFingerprint() != fingerprint))
{
- user->WriteNumeric(491, "This oper login requires a matching SSL certificate fingerprint.");
+ user->WriteNumeric(ERR_NOOPERHOST, "This oper login requires a matching SSL certificate fingerprint.");
user->CommandFloodPenalty += 10000;
return MOD_RES_DENY;
}
#include "inspircd.h"
#include "modules/invite.h"
+enum
+{
+ // InspIRCd-specific.
+ RPL_UNINVITED = 493
+};
+
/** Handle /UNINVITE
*/
class CommandUninvite : public Command
n.push(c->name).push(u->nick).push("Uninvited");
user->WriteRemoteNumeric(n);
- lu->WriteNumeric(493, InspIRCd::Format("You were uninvited from %s by %s", c->name.c_str(), user->nick.c_str()));
+ lu->WriteNumeric(RPL_UNINVITED, InspIRCd::Format("You were uninvited from %s by %s", c->name.c_str(), user->nick.c_str()));
std::string msg = "*** " + user->nick + " uninvited " + u->nick + ".";
c->WriteNotice(msg);
RPL_ENDOFWATCHLIST = 607,
// RPL_CLEARWATCH = 608, // unused
RPL_NOWISAWAY = 609,
- ERR_TOOMANYWATCH = 512
+ ERR_TOOMANYWATCH = 512,
+ ERR_INVALIDWATCHNICK = 942
};
class CommandWatch : public SplitCommand
}
else if (result == IRCv3::Monitor::Manager::WR_INVALIDNICK)
{
- user->WriteNumeric(942, nick, "Invalid nickname");
+ user->WriteNumeric(ERR_INVALIDWATCHNICK, nick, "Invalid nickname");
return;
}
else if (result != IRCv3::Monitor::Manager::WR_OK)