comments for pass.cpp
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
|
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
|
||||||
/* Updated: 2026/05/10 22:39:03 by aortigos ### ########.fr */
|
/* Updated: 2026/05/10 22:45:31 by aortigos ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ void Server::pass_cmd(User &client, std::istringstream &ss)
|
|||||||
ss >> args;
|
ss >> args;
|
||||||
if (client.isAuthenticated())
|
if (client.isAuthenticated())
|
||||||
{
|
{
|
||||||
|
// Still need to find what server should reply to different errors
|
||||||
std::string res = "You are already authenticated";
|
std::string res = "You are already authenticated";
|
||||||
send(client.getFd(), res.c_str(), res.size(), 0);
|
send(client.getFd(), res.c_str(), res.size(), 0);
|
||||||
return ;
|
return ;
|
||||||
@@ -26,6 +27,7 @@ void Server::pass_cmd(User &client, std::istringstream &ss)
|
|||||||
if (this->password_ == args)
|
if (this->password_ == args)
|
||||||
client->authenticated = true;
|
client->authenticated = true;
|
||||||
else {
|
else {
|
||||||
|
// Still need to find what server should reply to different errors
|
||||||
std::string res = "Invalid password";
|
std::string res = "Invalid password";
|
||||||
send(client.getFd(), res.c_str(), res.size(), 0);
|
send(client.getFd(), res.c_str(), res.size(), 0);
|
||||||
}
|
}
|
||||||
|
|||||||
2
tasks.md
2
tasks.md
@@ -48,7 +48,7 @@ Represents a connected IRC client.
|
|||||||
|
|
||||||
### Fourth stage
|
### Fourth stage
|
||||||
|
|
||||||
- [ ]Client can create/connect to channels
|
- [ ] Client can create/connect to channels
|
||||||
- [ ] JOIN command (user can create channel)
|
- [ ] JOIN command (user can create channel)
|
||||||
- [ ] PRIVMSG command (send message to a channel)
|
- [ ] PRIVMSG command (send message to a channel)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user