less lines, same code
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
|
||||
/* Updated: 2026/05/15 12:49:37 by aortigos ### ########.fr */
|
||||
/* Updated: 2026/05/15 22:08:10 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -32,12 +32,9 @@ void Server::nick_cmd(User &client, std::istringstream &ss)
|
||||
std::string args;
|
||||
|
||||
ss >> args;
|
||||
if (!client.isAuthenticated())
|
||||
return (client.send(":" SERVER_NAME " 451 * :You have not registered\r\n"));
|
||||
if (args.empty())
|
||||
return (client.send(":" SERVER_NAME " 431 * :Not nickname given\r\n"));
|
||||
if (!isValidNick(args))
|
||||
return (client.send(":" SERVER_NAME " 432 * " + args + " Erroneous nickname\r\n"));
|
||||
if (!client.isAuthenticated()) return (client.send(":" SERVER_NAME " 451 * :You have not registered\r\n"));
|
||||
if (args.empty()) return (client.send(":" SERVER_NAME " 431 * :Not nickname given\r\n"));
|
||||
if (!isValidNick(args)) return (client.send(":" SERVER_NAME " 432 * " + args + " Erroneous nickname\r\n"));
|
||||
for (std::map<int, User>::iterator it = clients_.begin(); it != clients_.end(); it++)
|
||||
{
|
||||
if (it->second.getNick() == args)
|
||||
|
||||
Reference in New Issue
Block a user