summaryrefslogtreecommitdiff
path: root/src/cmd_nick.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 10:57:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 10:57:25 +0000
commitd2be3310ba2cfb567f2cf0272a086b2961c86d6f (patch)
tree743e84c1bab0db4a58b44ff76e1227c23d54106a /src/cmd_nick.cpp
parentc24fcf728da0f04de9cc03b9ebbd5f85bab65081 (diff)
Add a call to the NICK handler that allows toggling of allowing invalid nicks to on or off.
Use it in ForceNickChange to allow forced nickchange of a nick to a uid. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7869 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_nick.cpp')
-rw-r--r--src/cmd_nick.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp
index a00803d75..f5c036dcf 100644
--- a/src/cmd_nick.cpp
+++ b/src/cmd_nick.cpp
@@ -77,7 +77,7 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
* here first, no TS checks need to take place here)
*/
userrec* InUse = ServerInstance->FindNick(parameters[0]);
- if (InUse && (InUse != user) && (ServerInstance->IsNick(parameters[0])))
+ if (InUse && (InUse != user) && ((ServerInstance->IsNick(parameters[0]) || allowinvalid)))
{
if (InUse->registered != REG_ALL)
{
@@ -98,7 +98,7 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
}
}
}
- if ((!ServerInstance->IsNick(parameters[0])) && (IS_LOCAL(user)))
+ if (((!allowinvalid || !ServerInstance->IsNick(parameters[0]))) && (IS_LOCAL(user)))
{
user->WriteServ("432 %s %s :Erroneous Nickname",user->nick,parameters[0]);
return CMD_FAILURE;
@@ -180,3 +180,8 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
}
+CmdResult cmd_nick::HandleInternal(const unsigned int id, const std::deque<classbase*> &parameters)
+{
+ allowinvalid = (id != 0);
+}
+