pass has been refactorized and nick command init
This commit is contained in:
28
cmds/nick.cpp
Normal file
28
cmds/nick.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* nick.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
|
||||
/* Updated: 2026/05/14 20:38:44 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../Server/Server.hpp"
|
||||
|
||||
void Server::nick_cmd(User &client, std::istringstream &ss)
|
||||
{
|
||||
std::string args;
|
||||
|
||||
ss >> args;
|
||||
if (args.empty())
|
||||
return (client.send(":" SERVER_NAME " 431 * :Not nickname given\r\n"));
|
||||
// Invalid characters in nick
|
||||
// 432 * badnick : Erroneous nickname
|
||||
// If nick exists
|
||||
// 4233 * takenick :Nickname is already in use
|
||||
if (client.getUsername())
|
||||
return (); // Broadcast in channels :oldnick!user@host NICK newnick
|
||||
}
|
||||
Reference in New Issue
Block a user