]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nicklock.cpp
Update wiki links to use HTTPS and point to the correct pages.
[user/henk/code/inspircd.git] / src / modules / m_nicklock.cpp
index 924ab8d81e1361d68639fcd16bce34e5860b5a29..4f5e5941cea5d653bb2453e19e154b4fcb68d82b 100644 (file)
@@ -42,7 +42,7 @@ class CommandNicklock : public Command
        {
                User* target = ServerInstance->FindNick(parameters[0]);
 
-               if (!target)
+               if ((!target) || (target->registered != REG_ALL))
                {
                        user->WriteServ("NOTICE %s :*** No such nickname: '%s'", user->nick.c_str(), parameters[0].c_str());
                        return CMD_FAILURE;
@@ -153,9 +153,9 @@ class ModuleNickLock : public Module
 
        void init()
        {
-               ServerInstance->AddCommand(&cmd1);
-               ServerInstance->AddCommand(&cmd2);
-               ServerInstance->Extensions.Register(&locked);
+               ServerInstance->Modules->AddService(cmd1);
+               ServerInstance->Modules->AddService(cmd2);
+               ServerInstance->Modules->AddService(locked);
                ServerInstance->Modules->Attach(I_OnUserPreNick, this);
        }
 
@@ -187,7 +187,7 @@ class ModuleNickLock : public Module
        void Prioritize()
        {
                Module *nflood = ServerInstance->Modules->Find("m_nickflood.so");
-               ServerInstance->Modules->SetPriority(this, I_OnUserPreJoin, PRIORITY_BEFORE, &nflood);
+               ServerInstance->Modules->SetPriority(this, I_OnUserPreNick, PRIORITY_BEFORE, &nflood);
        }
 };