- // ugh, nickchange failed for some reason -- possibly existing nick?
- User::QuitUser(ServerInstance, target, "Nickname collision");
+ target->Extend("nick_locked", "ON");
+ ServerInstance->SNO->WriteToSnoMask('A', user->nick+" used NICKLOCK to change and hold "+target->nick+" to "+parameters[1]);
+
+ /* Only send out nick from local server */
+ if (IS_LOCAL(target))
+ {
+ 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");
+ }
+ }