+ if (target && ServerInstance->ULine(target->server))
+ {
+ user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA 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 (!ServerInstance->IsNick(parameters[1].c_str(), ServerInstance->Config->Limits.NickMax))
+ {
+ user->WriteServ("NOTICE %s :*** Invalid nickname '%s'", user->nick.c_str(), parameters[1].c_str());
+ return CMD_FAILURE;
+ }
+ }
+
+ /* Have we hit target's server yet? */
+ if (target && IS_LOCAL(target))
+ {
+ std::string oldnick = user->nick;
+ std::string newnick = target->nick;
+ if (target->ForceNickChange(parameters[1].c_str()))
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
+ ServerInstance->PI->SendSNONotice("A", oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
+ }
+ else