Adding join channels and privmsg

This commit is contained in:
2026-04-17 19:12:05 +02:00
parent b3c190293a
commit 1c8ad9ba68
5 changed files with 64 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/17 11:56:55 by aortigos #+# #+# */
/* Updated: 2026/04/17 14:19:29 by aortigos ### ########.fr */
/* Updated: 2026/04/17 18:59:47 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -47,15 +47,16 @@ void Server::cmd_nick(int fd, std::istringstream &ss)
}
}
std::string msg = ":"
+ clients[fd].getNick()
+ " NICK "
+ args
+ "\r\n";
clients[fd].setNick(args);
if (!clients[fd].getNick().empty())
{
std::string msg = ":"
+ clients[fd].getNick()
+ " NICK "
+ args
+ "\r\n";
send(fd, msg.c_str(), msg.size(), 0);
}
send(fd, msg.c_str(), msg.size(), 0);
clients[fd].setNick(args);
}