Check if channel is empty #38

Merged
aortigos merged 1 commits from fix-privmsg-cmd into main 2026-05-25 08:03:48 +00:00
Showing only changes of commit fa65a4a2a7 - Show all commits

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 (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[0] == ' ')