]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sanick.cpp
Add ProtocolInterface::BroadcastEncap() and infrastructure for manually forwarding...
[user/henk/code/inspircd.git] / src / modules / m_sanick.cpp
index 822a5f948dc191226ceb67b2cbb20bcbcdfdafd6..ca6be2211978f2d92c1ac0608a8126acbddd96d3 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for SANICK command */
-
 /** Handle /SANICK
  */
 class CommandSanick : public Command
@@ -32,7 +30,7 @@ class CommandSanick : public Command
        {
                allow_empty_last_param = false;
                flags_needed = 'o'; Penalty = 0; syntax = "<nick> <new-nick>";
-               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+               TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
@@ -42,9 +40,9 @@ class CommandSanick : public Command
                /* Do local sanity checks and bails */
                if (IS_LOCAL(user))
                {
-                       if (target && ServerInstance->ULine(target->server))
+                       if (target && target->server->IsULine())
                        {
-                               user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
+                               user->WriteNumeric(ERR_NOPRIVILEGES, ":Cannot use an SA command on a u-lined client");
                                return CMD_FAILURE;
                        }
 
@@ -54,7 +52,7 @@ class CommandSanick : public Command
                                return CMD_FAILURE;
                        }
 
-                       if (!ServerInstance->IsNick(parameters[1], ServerInstance->Config->Limits.NickMax))
+                       if (!ServerInstance->IsNick(parameters[1]))
                        {
                                user->WriteNotice("*** Invalid nickname '" + parameters[1] + "'");
                                return CMD_FAILURE;
@@ -98,16 +96,10 @@ class ModuleSanick : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for SANICK command", VF_OPTCOMMON | VF_VENDOR);
        }
 };
 
 MODULE_INIT(ModuleSanick)
-