*/
#include "inspircd.h"
-#include "configreader.h"
-#include "users.h"
-#include "modules.h"
#include "xline.h"
#include "commands/cmd_nick.h"
* here first, no TS checks need to take place here)
*/
userrec* InUse = ServerInstance->FindNickOnly(parameters[0]);
- ServerInstance->Log(DEBUG,"Nick in use");
if (InUse && (InUse != user) && ((ServerInstance->IsNick(parameters[0]) || allowinvalid)))
{
if (InUse->registered != REG_ALL)
}
else
{
- ServerInstance->Log(DEBUG,"Nick in use and user REG_ALL");
user->WriteServ("433 %s %s :Nickname is already in use.", user->registered >= REG_NICK ? user->nick : "*", parameters[0]);
return CMD_FAILURE;
}
}
}
- if (user->registered == REG_ALL)
- {
- int MOD_RESULT = 0;
- FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,parameters[0]));
- if (MOD_RESULT) {
- // if a module returns true, the nick change is silently forbidden.
- return CMD_FAILURE;
- }
+ int MOD_RESULT = 0;
+ FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,parameters[0]));
+ if (MOD_RESULT)
+ // if a module returns true, the nick change is silently forbidden.
+ return CMD_FAILURE;
+ if (user->registered == REG_ALL)
user->WriteCommon("NICK %s",parameters[0]);
- }
-
strlcpy(oldnick, user->nick, NICKMAX - 1);
/* change the nick of the user in the users_hash */
user = user->UpdateNickHash(parameters[0]);
/* actually change the nick within the record */
- if (!user) return CMD_FAILURE;
- if (!*user->nick) return CMD_FAILURE;
+ if (!user)
+ return CMD_FAILURE;
+ if (!*user->nick)
+ return CMD_FAILURE;
strlcpy(user->nick, parameters[0], NICKMAX - 1);