now broadcast send message to every member of channel, excluding the author of message

This commit is contained in:
aortigos
2026-05-15 23:11:02 +02:00
parent 9a2d7919fb
commit a21bac6e47
8 changed files with 65 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
/* Updated: 2026/05/15 22:08:10 by aortigos ### ########.fr */
/* Updated: 2026/05/15 23:04:35 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -34,7 +34,7 @@ void Server::nick_cmd(User &client, std::istringstream &ss)
ss >> args;
if (!client.isAuthenticated()) return (client.send(":" SERVER_NAME " 451 * :You have not registered\r\n"));
if (args.empty()) return (client.send(":" SERVER_NAME " 431 * :Not nickname given\r\n"));
if (!isValidNick(args)) return (client.send(":" SERVER_NAME " 432 * " + args + " Erroneous nickname\r\n"));
if (!isValidNick(args)) return (client.send(":" SERVER_NAME " 432 * " + args + " :Erroneous nickname\r\n"));
for (std::map<int, User>::iterator it = clients_.begin(); it != clients_.end(); it++)
{
if (it->second.getNick() == args)