]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix a bunch more conflicting/unnamed numerics.
authorPeter Powell <petpow@saberuk.com>
Tue, 14 Aug 2018 18:18:15 +0000 (19:18 +0100)
committerPeter Powell <petpow@saberuk.com>
Tue, 14 Aug 2018 18:31:26 +0000 (19:31 +0100)
include/numerics.h
src/modules/m_autoop.cpp
src/modules/m_cban.cpp
src/modules/m_dccallow.cpp
src/modules/m_dnsbl.cpp
src/modules/m_joinflood.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_remove.cpp
src/modules/m_services_account.cpp

index 8c2f0ce11887194c86abfb8ef6f649ce29355b71..d1899b7570b6ea824b866430f7ce19e2cf6b2457 100644 (file)
@@ -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, // ???
index 3eab189f28cabb43115fae07715e0ef66f95928e..a09d0d9e425744607f168d9abaf57cb5f8bf0ae8 100644 (file)
@@ -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)
index 5f98def8f6eea222ad00672c0b9e992d0c15d4b6..d1fb23620b1d2b2ca01ef1c85f76d7a04158224c 100644 (file)
 #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;
index 04f85739a8317aa3db8a0b0634c03e58ef255315..f2d6bf105d03366767acc430959c58e9cc1c580c 100644 (file)
 
 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)
index 606feed1025c4d1203aef8d9b4625012a036e6ac..89fecf6968aa15bc419c7f52c15d037aaa031d7e 100644 (file)
@@ -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);
                                        }
 
index bd9e0ad9e23dda77748bb641d3413aa42a27c790..aaf2662166bf43a0ff971b7a40e0594e43749927 100644 (file)
 
 #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;
                        }
                }
index 67711f7665b8e60e381d6ff1c2f911839c0e4ed1..7d0e7fb8930ae16767a904841204412c79620cf2 100644 (file)
 
 #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;
                        }
                }
index d68a70503339e4d2dc37cd8607e6dc1a7a1c586c..8d60ff8c6e49632d6acf7f3ebca561a2be898252 100644 (file)
@@ -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;
                }
 
index c3f7155a6ff239e3e632676cee1ccd349b31060f..c3b84dbbac136a32a9131e20bcd77b7e1294dc6d 100644 (file)
@@ -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;
        }