Fixed kick command, doesnt accept empty values
This commit is contained in:
@@ -6,23 +6,10 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/25 09:27:35 by aortigos #+# #+# */
|
||||
/* Updated: 2026/05/25 09:46:13 by aortigos ### ########.fr */
|
||||
/* Updated: 2026/05/25 09:52:27 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* privmsg.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/15 15:35:16 by aortigos #+# #+# */
|
||||
/* Updated: 2026/05/25 09:25:49 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
#include "../Server/Server.hpp"
|
||||
|
||||
void Server::kick_cmd(User &client, std::istringstream &ss)
|
||||
@@ -36,6 +23,8 @@ void Server::kick_cmd(User &client, std::istringstream &ss)
|
||||
|
||||
if (!client.isRegistered()) return (client.send(":" SERVER_NAME " 451 " + client.getNick() + " :You have not registered\r\n"));
|
||||
|
||||
if (channel.empty() || user.empty())
|
||||
return (client.send(":" SERVER_NAME " 461 " + client.getNick() + " KICK :not enough parameters\r\n"));
|
||||
if (!reason.empty() && reason[0] == ' ')
|
||||
reason = reason.substr(1);
|
||||
if (!reason.empty() && reason[0] == ':')
|
||||
|
||||
Reference in New Issue
Block a user