Check if channel is empty
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/05/15 15:35:16 by aortigos #+# #+# */
|
/* Created: 2026/05/15 15:35:16 by aortigos #+# #+# */
|
||||||
/* Updated: 2026/05/25 09:44:38 by aortigos ### ########.fr */
|
/* Updated: 2026/05/25 10:02:13 by aortigos ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -22,6 +22,9 @@ void Server::privmsg_cmd(User &client, std::istringstream &ss)
|
|||||||
|
|
||||||
if (!client.isRegistered()) return (client.send(":" SERVER_NAME " 451 " + client.getNick() + " :You have not registered\r\n"));
|
if (!client.isRegistered()) return (client.send(":" SERVER_NAME " 451 " + client.getNick() + " :You have not registered\r\n"));
|
||||||
|
|
||||||
|
if (channel.empty())
|
||||||
|
return (client.send(":" SERVER_NAME " 411 " + client.getNick() + " :No recipient given (PRIVMSG)\r\n"));
|
||||||
|
|
||||||
if (message.empty()) return (client.send(":" SERVER_NAME " 412 " + client.getNick() + " :No text to send\r\n"));
|
if (message.empty()) return (client.send(":" SERVER_NAME " 412 " + client.getNick() + " :No text to send\r\n"));
|
||||||
|
|
||||||
if (message[0] == ' ')
|
if (message[0] == ' ')
|
||||||
|
|||||||
Reference in New Issue
Block a user