+ User* target = ServerInstance->FindNick(parameters[0]);
+
+ /* Do local sanity checks and bails */
+ if (IS_LOCAL(user))
+ {
+ if (target && ServerInstance->ULine(target->server))
+ {
+ user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an NICKUNLOCK command on a u-lined client",user->nick.c_str());
+ return CMD_FAILURE;
+ }
+
+ if (!target)
+ {
+ user->WriteServ("NOTICE %s :*** No such nickname: '%s'", user->nick.c_str(), parameters[0].c_str());
+ return CMD_FAILURE;
+ }
+
+ if (!target->GetExt("nick_locked"))
+ {
+ user->WriteNumeric(946, "%s %s :This user's nickname is not locked.",user->nick.c_str(),target->nick.c_str());
+ return CMD_FAILURE;
+ }
+ }
+
+ /* If we made it this far, the command is going out on the wire so send local snotice */
+ ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used NICKUNLOCK on "+parameters[0]);
+
+ if (target)