summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-08-14 19:18:15 +0100
committerPeter Powell <petpow@saberuk.com>2018-08-14 19:31:26 +0100
commita69f543be3bb6df77bfc19eaadc313d405ec2d45 (patch)
tree3a8620f14ea20715ceec71df828a1a76428314b9
parent95a701b9d84b34b5882a9d511901f9a9c6e7b00a (diff)
Fix a bunch more conflicting/unnamed numerics.
-rw-r--r--include/numerics.h1
-rw-r--r--src/modules/m_autoop.cpp2
-rw-r--r--src/modules/m_cban.cpp8
-rw-r--r--src/modules/m_dccallow.cpp17
-rw-r--r--src/modules/m_dnsbl.cpp4
-rw-r--r--src/modules/m_joinflood.cpp8
-rw-r--r--src/modules/m_kicknorejoin.cpp9
-rw-r--r--src/modules/m_remove.cpp2
-rw-r--r--src/modules/m_services_account.cpp4
9 files changed, 37 insertions, 18 deletions
diff --git a/include/numerics.h b/include/numerics.h
index 8c2f0ce11..d1899b757 100644
--- a/include/numerics.h
+++ b/include/numerics.h
@@ -159,7 +159,6 @@ enum
ERR_RESTRICTED = 484,
ERR_NOOPERHOST = 491,
- ERR_DELAYREJOIN = 495, // insp-specific, XXX: we should use 'resource temporarily unavailable' from ircnet/ratbox or whatever
ERR_UNKNOWNSNOMASK = 501, // insp-specific
ERR_USERSDONTMATCH = 502,
ERR_CANTSENDTOUSER = 531, // ???
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp
index 3eab189f2..a09d0d9e4 100644
--- a/src/modules/m_autoop.cpp
+++ b/src/modules/m_autoop.cpp
@@ -52,7 +52,7 @@ class AutoOpList : public ListModeBase
if (adding && !mh)
{
- source->WriteNumeric(415, mid, InspIRCd::Format("Cannot find prefix mode '%s' for autoop", mid.c_str()));
+ source->WriteNumeric(ERR_UNKNOWNMODE, mid, InspIRCd::Format("Cannot find prefix mode '%s' for autoop", mid.c_str()));
return MOD_RES_DENY;
}
else if (!mh)
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 5f98def8f..d1fb23620 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -24,6 +24,12 @@
#include "xline.h"
#include "modules/stats.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_BADCHANNEL = 926
+};
+
/** Holds a CBAN item
*/
class CBan : public XLine
@@ -180,7 +186,7 @@ class ModuleCBan : public Module, public Stats::EventListener
if (rl)
{
// Channel is banned.
- user->WriteNumeric(384, cname, InspIRCd::Format("Cannot join channel, CBANed (%s)", rl->reason.c_str()));
+ user->WriteNumeric(ERR_BADCHANNEL, cname, InspIRCd::Format("Channel %s is CBANed: %s", cname.c_str(), rl->reason.c_str()));
ServerInstance->SNO->WriteGlobalSno('a', "%s tried to join %s which is CBANed (%s)",
user->nick.c_str(), cname.c_str(), rl->reason.c_str());
return MOD_RES_DENY;
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index 04f85739a..f2d6bf105 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -27,6 +27,11 @@
enum
{
+ // From ircd-ratbox.
+ RPL_HELPSTART = 704,
+ RPL_HELPTXT = 705,
+ RPL_ENDOFHELP = 706,
+
// InspIRCd-specific?
RPL_DCCALLOWSTART = 990,
RPL_DCCALLOWLIST = 991,
@@ -36,16 +41,11 @@ enum
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
+ ERR_UNKNOWNDCCALLOWCMD = 998
};
static const char* const helptext[] =
{
- "DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP]",
"You may allow DCCs from specific users by specifying a",
"DCC allow for the user you want to receive DCCs from.",
"For example, to allow the user Brain to send you inspircd.exe",
@@ -259,9 +259,10 @@ class CommandDccallow : public Command
void DisplayHelp(User* user)
{
+ user->WriteNumeric(RPL_HELPSTART, "*", "DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP]");
for (size_t i = 0; i < sizeof(helptext)/sizeof(helptext[0]); i++)
- user->WriteNumeric(RPL_DCCALLOWHELP, helptext[i]);
- user->WriteNumeric(RPL_ENDOFDCCALLOWHELP, "End of DCCALLOW HELP");
+ user->WriteNumeric(RPL_HELPTXT, "*", helptext[i]);
+ user->WriteNumeric(RPL_ENDOFHELP, "*", "End of DCCALLOW HELP");
LocalUser* localuser = IS_LOCAL(user);
if (localuser)
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 606feed10..89fecf696 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -128,13 +128,13 @@ class DNSBLResolver : public DNS::Request
{
if (!ConfEntry->ident.empty())
{
- them->WriteNumeric(304, "Your ident has been set to " + ConfEntry->ident + " because you matched " + reason);
+ them->WriteNotice("Your ident has been set to " + ConfEntry->ident + " because you matched " + reason);
them->ChangeIdent(ConfEntry->ident);
}
if (!ConfEntry->host.empty())
{
- them->WriteNumeric(304, "Your host has been set to " + ConfEntry->host + " because you matched " + reason);
+ them->WriteNotice("Your host has been set to " + ConfEntry->host + " because you matched " + reason);
them->ChangeDisplayedHost(ConfEntry->host);
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index bd9e0ad9e..aaf266216 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -23,6 +23,12 @@
#include "inspircd.h"
+enum
+{
+ // From RFC 2182.
+ ERR_UNAVAILRESOURCE = 437
+};
+
// The number of seconds the channel will be closed for.
static unsigned int duration;
@@ -145,7 +151,7 @@ class ModuleJoinFlood : public Module
joinfloodsettings *f = jf.ext.get(chan);
if (f && f->islocked())
{
- user->WriteNumeric(609, chan->name, "This channel is temporarily unavailable (+j). Please try again later.");
+ user->WriteNumeric(ERR_UNAVAILRESOURCE, chan->name, "This channel is temporarily unavailable (+j). Please try again later.");
return MOD_RES_DENY;
}
}
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 67711f766..7d0e7fb89 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -25,6 +25,13 @@
#include "inspircd.h"
+enum
+{
+ // From RFC 2182.
+ ERR_UNAVAILRESOURCE = 437
+};
+
+
class KickRejoinData
{
struct KickedUser
@@ -135,7 +142,7 @@ public:
const KickRejoinData* data = kr.ext.get(chan);
if ((data) && (!data->canjoin(user)))
{
- user->WriteNumeric(ERR_DELAYREJOIN, chan, InspIRCd::Format("You must wait %u seconds after being kicked to rejoin (+J)", data->delay));
+ user->WriteNumeric(ERR_UNAVAILRESOURCE, chan, InspIRCd::Format("You must wait %u seconds after being kicked to rejoin (+J)", data->delay));
return MOD_RES_DENY;
}
}
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index d68a70503..8d60ff8c6 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -93,7 +93,7 @@ class RemoveBase : public Command
if (target->server->IsULine())
{
- user->WriteNumeric(482, channame, "Only a u-line may remove a u-line from a channel.");
+ user->WriteNumeric(ERR_CHANOPRIVSNEEDED, channame, "Only a u-line may remove a u-line from a channel.");
return CMD_FAILURE;
}
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index c3f7155a6..c3b84dbba 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -64,7 +64,7 @@ class Channel_r : public ModeHandler
}
else
{
- source->WriteNumeric(500, "Only a server may modify the +r channel mode");
+ source->WriteNumeric(ERR_NOPRIVILEGES, "Only a server may modify the +r channel mode");
}
return MODEACTION_DENY;
}
@@ -90,7 +90,7 @@ class User_r : public ModeHandler
}
else
{
- source->WriteNumeric(500, "Only a server may modify the +r user mode");
+ source->WriteNumeric(ERR_NOPRIVILEGES, "Only a server may modify the +r user mode");
}
return MODEACTION_DENY;
}