*/
#include "inspircd.h"
-#include "configreader.h"
-#include "users.h"
-#include "modules.h"
#include "xline.h"
#include "commands/cmd_nick.h"
* the nickname too, we force a nickchange on the older user (Simply the one who was
* here first, no TS checks need to take place here)
*/
- userrec* InUse = ServerInstance->FindNick(parameters[0]);
+ userrec* InUse = ServerInstance->FindNickOnly(parameters[0]);
if (InUse && (InUse != user) && ((ServerInstance->IsNick(parameters[0]) || allowinvalid)))
{
if (InUse->registered != REG_ALL)
}
}
}
- if (((!allowinvalid || !ServerInstance->IsNick(parameters[0]))) && (IS_LOCAL(user)))
+ if (((!ServerInstance->IsNick(parameters[0]))) && (IS_LOCAL(user)))
{
- user->WriteServ("432 %s %s :Erroneous Nickname",user->nick,parameters[0]);
- return CMD_FAILURE;
+ if (!allowinvalid)
+ {
+ user->WriteServ("432 %s %s :Erroneous Nickname",user->nick,parameters[0]);
+ return CMD_FAILURE;
+ }
}
if (user->registered == REG_ALL)
CmdResult cmd_nick::HandleInternal(const unsigned int id, const std::deque<classbase*> ¶meters)
{
allowinvalid = (id != 0);
+ return CMD_SUCCESS;
}