mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix the numeric sent when a U-lined alias target is not online.
This commit is contained in:
parent
fa0256cc80
commit
67215adc97
@ -113,6 +113,7 @@ enum
|
||||
ERR_CANNOTSENDTOCHAN = 404,
|
||||
ERR_TOOMANYCHANNELS = 405,
|
||||
ERR_WASNOSUCHNICK = 406,
|
||||
ERR_NOSUCHSERVICE = 408, // From RFC 2812.
|
||||
ERR_NOTEXTTOSEND = 412,
|
||||
ERR_UNKNOWNCOMMAND = 421,
|
||||
ERR_NOMOTD = 422,
|
||||
|
@ -24,11 +24,6 @@
|
||||
|
||||
#include "inspircd.h"
|
||||
|
||||
enum
|
||||
{
|
||||
// From RFC 2812.
|
||||
ERR_NOSUCHSERVICE = 408
|
||||
};
|
||||
|
||||
class MessageDetailsImpl : public MessageDetails
|
||||
{
|
||||
|
@ -286,17 +286,18 @@ class ModuleAlias : public Module
|
||||
|
||||
if (!a->RequiredNick.empty())
|
||||
{
|
||||
int numeric = a->ULineOnly ? ERR_NOSUCHSERVICE : ERR_NOSUCHNICK;
|
||||
User* u = ServerInstance->FindNickOnly(a->RequiredNick);
|
||||
if (!u)
|
||||
{
|
||||
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is currently unavailable. Please try again later.");
|
||||
user->WriteNumeric(numeric, a->RequiredNick, "is currently unavailable. Please try again later.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((a->ULineOnly) && (!u->server->IsULine()))
|
||||
{
|
||||
ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a U-lined server, possibly underhanded antics detected!");
|
||||
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is not a network service! Please inform a server operator as soon as possible.");
|
||||
user->WriteNumeric(numeric, a->RequiredNick, "is not a network service! Please inform a server operator as soon as possible.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user