+ // check nick is valid
+ if (IS_LOCAL(user) && !ServerInstance->IsNick(parameters[1].c_str(), ServerInstance->Config->Limits.NickMax))
+ {
+ return CMD_FAILURE;
+ }
+
+ // let others know
+ ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used NICKLOCK to change and hold "+parameters[0]+" to "+parameters[1]);
+
+ if (!target->ForceNickChange(parameters[1].c_str()))
+ {
+ // 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
+ target->Extend("nick_locked", "ON");
+
+ /* route */
+ return CMD_SUCCESS;