]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_user/cmd_part.cpp
Merge insp20
[user/henk/code/inspircd.git] / src / coremods / core_user / cmd_part.cpp
index 9f82c15a501d5e1641998de5009c616625249c02..4da2787d902b13f4d958e1d65ab0d1c8d86bdd2e 100644 (file)
@@ -44,13 +44,15 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User
 
        Channel* c = ServerInstance->FindChan(parameters[0]);
 
-       if (c)
+       if (!c)
        {
-               c->PartUser(user, reason);
+               user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
+               return CMD_FAILURE;
        }
-       else
+
+       if (!c->PartUser(user, reason))
        {
-               user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str());
+               user->WriteNumeric(ERR_NOTONCHANNEL, c->name, "You're not on that channel");
                return CMD_FAILURE;
        }