je t'aime
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/01/21 10:36:21 by maldavid #+# #+# */
|
/* Created: 2024/01/21 10:36:21 by maldavid #+# #+# */
|
||||||
/* Updated: 2024/01/23 17:23:24 by vvaas ### ########.fr */
|
/* Updated: 2024/01/23 17:43:02 by vvaas ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
@@ -21,16 +21,12 @@ namespace irc
|
|||||||
|
|
||||||
void Channel::addClient(unstd::SharedPtr<Client> client)
|
void Channel::addClient(unstd::SharedPtr<Client> client)
|
||||||
{
|
{
|
||||||
for (std::set<unstd::SharedPtr<Client> >::iterator it = _clients.begin(); it != _clients.end(); ++it)
|
if (!_clients.insert(client).second)
|
||||||
{
|
{
|
||||||
if (const_cast<unstd::SharedPtr<irc::Client>&>(*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");
|
||||||
logs::report(log_message, "%s is already is channel for", client->getNickName().c_str());
|
return ;
|
||||||
client->sendCode(ERR_USERONCHANNEL, "You are already in the channel");
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
logs::report(log_message, "i tried to insert %s, success : %d", client->getNickName().c_str(), _clients.insert(client).second);
|
|
||||||
for(std::set<unstd::SharedPtr<Client> >::iterator it = _clients.begin(); it != _clients.end(); ++it)
|
for(std::set<unstd::SharedPtr<Client> >::iterator it = _clients.begin(); it != _clients.end(); ++it)
|
||||||
{
|
{
|
||||||
const_cast<unstd::SharedPtr<irc::Client>&>(*it)->sendMsg(client->getNickName(), "JOIN", _name);
|
const_cast<unstd::SharedPtr<irc::Client>&>(*it)->sendMsg(client->getNickName(), "JOIN", _name);
|
||||||
|
|||||||
Reference in New Issue
Block a user