From 7d7250484c352c13830e63ae41ee8faae40a9bd5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 25 May 2008 17:30:43 +0000 Subject: First phase of conversion to dynamic limits on all the lengths, configured via the tag (the tag isnt there yet, these all just run on defaults in the class constructor) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9802 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_nicklock.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/modules/m_nicklock.cpp') diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index adeab2691..86054ab3e 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -48,7 +48,7 @@ class CommandNicklock : public Command } // check nick is valid - if (!ServerInstance->IsNick(parameters[1].c_str())) + if (IS_LOCAL(user) && !ServerInstance->IsNick(parameters[1].c_str(), ServerInstance->Config->Limits.NickMax)) { return CMD_FAILURE; } @@ -58,8 +58,12 @@ class CommandNicklock : public Command if (!target->ForceNickChange(parameters[1].c_str())) { - // ugh, nickchange failed for some reason -- possibly existing nick? XXX change to UID here - ServerInstance->Users->QuitUser(target, "Nickname collision"); + // ugh, nickchange failed for some reason -- possibly existing nick? + if (!target->ForceNickChange(target->uuid.c_str())) + { + // Well shit, we cant even change them to their UID (this should not happen!) + ServerInstance->Users->QuitUser(target, "Nickname collision"); + } } // give them a lock flag -- cgit v1.2.3