@@ -63,32+56,34 @@ class CommandNicklock : public Command
}
/* If we made it this far, extend the user */
- if (target)
+ if (target && IS_LOCAL(target))
{
// This has to be done *here*, because this metadata must be stored netwide.
target->Extend("nick_locked", "ON");
/* Only send out nick from local server */
- if (IS_LOCAL(target))
+ target->Extend("nick_locked");
+
+ std::string oldnick = target->nick;
+ if (target->ForceNickChange(parameters[1].c_str()))
+ ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK to change and hold "+oldnick+" to "+parameters[1]);
+ else
{
- ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK to change and hold "+target->nick+" to "+parameters[1]);
- std::string oldnick = user->nick;
std::string newnick = target->nick;
- if (!target->ForceNickChange(parameters[1].c_str()))
- {
- /* XXX: We failed, this *should* not happen but if it does
- * tell everybody. Note user is still nick locked on their old
- * nick instead.
- */
- ServerInstance->SNO->WriteToSnoMask('a', oldnick+" failed nickchange on NICKLOCK (from "+newnick+" to "+parameters[1]+") Locked to "+newnick+" instead");
- ServerInstance->PI->SendSNONotice("A", oldnick+" failed nickchange on NICKLOCK (from "+newnick+" to "+parameters[1]+") Locked to "+newnick+" instead");
- }
+ ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK, but "+oldnick+" failed nick change to "+parameters[1]+" and was locked to "+newnick+" instead");