X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nicklock.cpp;h=6c4101bc5fe4b7e7df359d2c1b905dea3b53ca55;hb=1f38b9adb576580d8e8638fefc5c7cb157f90a5c;hp=8e0d5ae7f0da0a5b26a86132f060f121d35e1e23;hpb=8f27fefa75e2952e7ab8757eb9fe4af4586817f0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 8e0d5ae7f..6c4101bc5 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -22,8 +22,6 @@ #include "inspircd.h" -/* $ModDesc: Provides the NICKLOCK command, allows an oper to change a users nick and lock them to it until they quit */ - /** Handle /NICKLOCK */ class CommandNicklock : public Command @@ -35,7 +33,7 @@ class CommandNicklock : public Command { flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector& parameters, User *user) @@ -66,7 +64,7 @@ class CommandNicklock : public Command locked.set(target, 1); std::string oldnick = target->nick; - if (target->ForceNickChange(parameters[1].c_str())) + if (target->ForceNickChange(parameters[1])) ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK to change and hold "+oldnick+" to "+parameters[1]); else { @@ -98,7 +96,7 @@ class CommandNickunlock : public Command { flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_NICK, TR_END); + TRANSLATE1(TR_NICK); } CmdResult Handle (const std::vector& parameters, User *user) @@ -155,7 +153,6 @@ class ModuleNickLock : public Module ServerInstance->Modules->AddService(cmd1); ServerInstance->Modules->AddService(cmd2); ServerInstance->Modules->AddService(locked); - ServerInstance->Modules->Attach(I_OnUserPreNick, this); } Version GetVersion() CXX11_OVERRIDE @@ -168,9 +165,6 @@ class ModuleNickLock : public Module if (!IS_LOCAL(user)) return MOD_RES_PASSTHRU; - if (ServerInstance->NICKForced.get(user)) /* Allow forced nick changes */ - return MOD_RES_PASSTHRU; - if (locked.get(user)) { user->WriteNumeric(447, "%s :You cannot change your nickname (your nick is locked)",user->nick.c_str()); @@ -182,7 +176,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); } };