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, // ???
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)
#include "xline.h"
#include "modules/stats.h"
+enum
+{
+ // InspIRCd-specific.
+ ERR_BADCHANNEL = 926
+};
+
/** Holds a CBAN item
*/
class CBan : public XLine
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;
enum
{
+ // From ircd-ratbox.
+ RPL_HELPSTART = 704,
+ RPL_HELPTXT = 705,
+ RPL_ENDOFHELP = 706,
+
// InspIRCd-specific?
RPL_DCCALLOWSTART = 990,
RPL_DCCALLOWLIST = 991,
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",
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)
{
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);
}
#include "inspircd.h"
+enum
+{
+ // From RFC 2182.
+ ERR_UNAVAILRESOURCE = 437
+};
+
// The number of seconds the channel will be closed for.
static unsigned int duration;
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;
}
}
#include "inspircd.h"
+enum
+{
+ // From RFC 2182.
+ ERR_UNAVAILRESOURCE = 437
+};
+
+
class KickRejoinData
{
struct KickedUser
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;
}
}
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;
}
}
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;
}
}
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;
}