]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nicklock.cpp
Fix for bug #415, affects only trunk (wish i'd known this before i started!)
[user/henk/code/inspircd.git] / src / modules / m_nicklock.cpp
index 8c81fd4c304ed2b1119d9740e16400e3d857dcc6..731c0433dd165012c5889a423891e323e8ef1bc6 100644 (file)
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "hashcomp.h"
 
 /* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */
 
@@ -29,6 +25,7 @@ class cmd_nicklock : public command_t
        {
                this->source = "m_nicklock.so";
                syntax = "<oldnick> <newnick>";
+               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
 
        CmdResult Handle(const char** parameters, int pcnt, userrec *user)
@@ -63,7 +60,6 @@ class cmd_nicklock : public command_t
                {
                        // ugh, nickchange failed for some reason -- possibly existing nick?
                        userrec::QuitUser(ServerInstance, source, "Nickname collision");
-                       return CMD_FAILURE;
                }
 
                // give them a lock flag
@@ -133,6 +129,9 @@ class ModuleNickLock : public Module
 
        virtual int OnUserPreNick(userrec* user, const std::string &newnick)
        {
+               if (isdigit(newnick[0])) /* allow a switch to a UID */
+                       return 0;
+
                if (user->GetExt("nick_locked", n))
                {
                        user->WriteServ("447 %s :You cannot change your nickname (your nick is locked)",user->nick);