summaryrefslogtreecommitdiff
path: root/src/cmd_part.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_part.cpp')
-rw-r--r--src/cmd_part.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cmd_part.cpp b/src/cmd_part.cpp
index 39a962140..1b9680d5d 100644
--- a/src/cmd_part.cpp
+++ b/src/cmd_part.cpp
@@ -26,13 +26,17 @@ void cmd_part::Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0))
return;
+
+ chanrec* c = FindChan(parameters[0]);
- if (pcnt > 1)
+ if (c)
{
- del_channel(user,parameters[0],parameters[1],false);
+ if (!c->PartUser(user, pcnt > 1 ? parameters[0] : NULL))
+ /* Arse, who stole our channel! :/ */
+ delete c;
}
else
{
- del_channel(user,parameters[0],NULL,false);
+ WriteServ(user->fd, "401 %s %s :No such channel", user->nick, parameters[0]);
}
}