]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix the numeric sent when a U-lined alias target is not online.
authorSadie Powell <sadie@witchery.services>
Thu, 18 Feb 2021 04:10:14 +0000 (04:10 +0000)
committerSadie Powell <sadie@witchery.services>
Thu, 18 Feb 2021 04:10:14 +0000 (04:10 +0000)
include/numerics.h
src/coremods/core_message.cpp
src/modules/m_alias.cpp

index a34d9b1e18f8a717943f19ee839906d857e923b6..98abf2bbedbf4dd3915a7ec6cd293e7efd52586c 100644 (file)
@@ -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,
index 26573c8bf9262b07fb8c78ac83a087bb6766b6c4..75abd69005966db91c05634429b644b4582da21d 100644 (file)
 
 #include "inspircd.h"
 
-enum
-{
-       // From RFC 2812.
-       ERR_NOSUCHSERVICE = 408
-};
 
 class MessageDetailsImpl : public MessageDetails
 {
index df7add05cc93112da3c05f014b6a8c9095e3359c..478bfb3d9149a0f51be52184019802a5660fcc86 100644 (file)
@@ -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;
                        }
                }