28 lines
1.3 KiB
C++
28 lines
1.3 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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
|
|
} |