From 839666bbbd933ea23baf86cdb8ac00c4e35d747c Mon Sep 17 00:00:00 2001 From: Namonay Date: Tue, 23 Jan 2024 17:32:10 +0100 Subject: [PATCH] :) --- srcs/channel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/srcs/channel.cpp b/srcs/channel.cpp index 5758bc6..61a3a43 100644 --- a/srcs/channel.cpp +++ b/srcs/channel.cpp @@ -6,13 +6,14 @@ /* By: vvaas +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/21 10:36:21 by maldavid #+# #+# */ -/* Updated: 2024/01/23 17:10:16 by vvaas ### ########.fr */ +/* Updated: 2024/01/23 17:23:24 by vvaas ### ########.fr */ /* */ /******************************************************************************/ #include #include #include +#include namespace irc { @@ -25,10 +26,11 @@ namespace irc if (const_cast&>(*it)->getNickName() == client->getNickName()) { logs::report(log_message, "%s is already is channel for", client->getNickName().c_str()); + client->sendCode(ERR_USERONCHANNEL, "You are already in the channel"); return ; } } - _clients.insert(client); + logs::report(log_message, "i tried to insert %s, success : %d", client->getNickName().c_str(), _clients.insert(client).second); for(std::set >::iterator it = _clients.begin(); it != _clients.end(); ++it) { const_cast&>(*it)->sendMsg(client->getNickName(), "JOIN", _name);