}
// check nick is valid
- if (!ServerInstance->IsNick(parameters[1].c_str()))
+ if (IS_LOCAL(user) && !ServerInstance->IsNick(parameters[1].c_str(), ServerInstance->Config->Limits.NickMax))
{
return CMD_FAILURE;
}
if (!target->ForceNickChange(parameters[1].c_str()))
{
- // ugh, nickchange failed for some reason -- possibly existing nick? XXX change to UID here
- ServerInstance->Users->QuitUser(target, "Nickname collision");
+ // 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
ModuleNickLock(InspIRCd* Me)
: Module(Me)
{
-
+
cmd1 = new CommandNicklock(ServerInstance);
cmd2 = new CommandNickunlock(ServerInstance);
ServerInstance->AddCommand(cmd1);
Implementation eventlist[] = { I_OnUserPreNick, I_OnUserQuit, I_OnCleanup };
ServerInstance->Modules->Attach(eventlist, this, 3);
}
-
+
virtual ~ModuleNickLock()
{
}
-
+
virtual Version GetVersion()
{
return Version(1, 2, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);