commands whois, whowas created and fixed, update ping, nick, commands.cpp, update Server and user

This commit is contained in:
Samy Ben Tayeb 2025-06-17 18:04:21 +02:00
parent 597aed08d8
commit 6ffc1e5534
16 changed files with 250 additions and 34 deletions

View file

@ -6,7 +6,7 @@
/* By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/24 17:29:48 by rparodi #+# #+# */
/* Updated: 2025/06/16 18:30:15 by sben-tay ### ########.fr */
/* Updated: 2025/06/17 16:56:36 by sben-tay ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,8 +21,9 @@ e_code cmd::Nick::checkArgs() {
return ERR_NONICKNAMEGIVEN;
}
User* existing = searchList<User*>(_users, _args[1]); // à adapter si besoin
if (existing != NULL) {
_sender->appendToWriteBuffer(":" + _sender->getPrefix() + " 433 * " + _args[1] + " :Nickname is already in use\r\n");
if (existing != NULL) {
std::string msg433 = ":" + _sender->getPrefix() + " 433 * " + _args[1] + " :Nickname is already in use\r\n";
_sender->appendToWriteBuffer(msg433);
return ERR_NICKNAMEINUSE;
}
return _PARSING_OK;