Added working INVITE command

This commit is contained in:
iherman-
2026-05-23 21:38:02 +02:00
parent dd4de38e5f
commit bed4006e90
7 changed files with 86 additions and 10 deletions

View File

@@ -6,7 +6,7 @@
/* By: iherman- <iherman-@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/05/23 17:15:27 by iherman- #+# #+# */
/* Updated: 2026/05/23 18:35:51 by iherman- ### ########.fr */
/* Updated: 2026/05/23 20:25:02 by iherman- ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,7 +19,7 @@ void Server::mode_cmd(User &client, std::istringstream &ss)
std::string args;
ss >> target >> mode;
std::getline(ss, args);
std::getline(ss, args); // might include space in channel name, need to fix
if (!client.isRegistered()) return (client.send(":" SERVER_NAME " 451 * :You have not registered\r\n"));
if (target.empty() || mode.empty()) return (client.send(":" SERVER_NAME " 461 " + client.getNick() + " MODE :Not enough parameters\r\n"));
@@ -27,7 +27,7 @@ void Server::mode_cmd(User &client, std::istringstream &ss)
std::map<std::string, Channel>::iterator channel = channels_.find(target);
if (channel == channels_.end())
{
client.send(":" SERVER_NAME " 403 " + client.getNick() + target + ":No such channel");
client.send(":" SERVER_NAME " 403 " + client.getNick() + target + ":No such channel\r\n");
return ;
}
@@ -37,5 +37,5 @@ void Server::mode_cmd(User &client, std::istringstream &ss)
return ;
}
channel->second.setMode(mode, args);
channel->second.setMode(mode, args); // args should prob be a stringstream :(
}