summaryrefslogtreecommitdiff
path: root/src/cmd_join.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_join.cpp')
-rw-r--r--src/cmd_join.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/cmd_join.cpp b/src/cmd_join.cpp
index fc63283e5..728038c2e 100644
--- a/src/cmd_join.cpp
+++ b/src/cmd_join.cpp
@@ -24,15 +24,28 @@ extern InspIRCd* ServerInstance;
void cmd_join::Handle (const char** parameters, int pcnt, userrec *user)
{
- if (ServerInstance->Parser->LoopCall(this, parameters, pcnt, user, 0, 0, 1))
- return;
-
- if (IsValidChannelName(parameters[0]))
+ if (pcnt > 1)
{
- 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
{
- WriteServ(user->fd,"403 %s %s :Invalid channel name",user->nick, parameters[0]);
+ 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]);
}