Improving commands and added quit

This commit is contained in:
aortigos
2026-05-16 11:47:45 +02:00
parent 3de8940560
commit 66bd57bfde
9 changed files with 108 additions and 11 deletions

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/05/15 15:35:16 by aortigos #+# #+# */
/* Updated: 2026/05/15 22:18:52 by aortigos ### ########.fr */
/* Updated: 2026/05/16 11:22:00 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,6 +28,7 @@ void Server::join_cmd(User &client, std::istringstream &ss)
channels_[args] = Channel(args);
channels_[args].addMember(client.getFd());
channels_[args].addOperator(client.getFd());
client.joinChannel(args);
return (client.send("Channel created\r\n"));
}
else
@@ -35,6 +36,9 @@ void Server::join_cmd(User &client, std::istringstream &ss)
if (it->second.hasMember(client.getFd()))
client.send("You are already in this channel\r\n");
else
{
client.joinChannel(it->first);
it->second.addMember(client.getFd());
}
}
}