X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nicklock.cpp;h=4f5e5941cea5d653bb2453e19e154b4fcb68d82b;hb=aa19c8fc021ce1cc704434a2c5a19e1517132c79;hp=924ab8d81e1361d68639fcd16bce34e5860b5a29;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 924ab8d81..4f5e5941c 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -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); } };