X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_join.cpp;h=728038c2eb11d600700f489fd64a09ace172df78;hb=c4458ecc70025aeac7ca87115ed0a698e7bbcdad;hp=148de057ee5f95243174140b088364f6708747c7;hpb=1383dba43e463f292aea094d01f62f355946049d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_join.cpp b/src/cmd_join.cpp index 148de057e..728038c2e 100644 --- a/src/cmd_join.cpp +++ b/src/cmd_join.cpp @@ -14,47 +14,38 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" #include "inspircd.h" -#include "inspircd_io.h" -#include -#include -#ifdef GCC3 -#include -#else -#include -#endif -#include -#include -#include -#include #include "users.h" -#include "ctables.h" -#include "globals.h" -#include "message.h" #include "commands.h" -#include "inspstring.h" #include "helperfuncs.h" -#include "hashcomp.h" -#include "typedefs.h" -#include "command_parse.h" -#include "cmd_join.h" +#include "commands/cmd_join.h" extern InspIRCd* ServerInstance; -void cmd_join::Handle (char **parameters, int pcnt, userrec *user) +void cmd_join::Handle (const char** parameters, int pcnt, userrec *user) { - chanrec* Ptr; - - if (ServerInstance->Parser->LoopCall(this,parameters,pcnt,user,0,0,1)) - return; - if (parameters[0][0] == '#') + if (pcnt > 1) { - Ptr = add_channel(user,parameters[0],parameters[1],false); - } -} + if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0, 1)) + return; + if (IsValidChannelName(parameters[0])) + { + add_channel(user, parameters[0], parameters[1], false); + return; + } + } + else + { + if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) + return; + if (IsValidChannelName(parameters[0])) + { + add_channel(user, parameters[0], "", false); + return; + } + } + WriteServ(user->fd,"403 %s %s :Invalid channel name",user->nick, parameters[0]); +}