fixing vavaas mental issues

This commit is contained in:
Kbz-8
2024-02-06 12:32:20 +01:00
parent cc8c186d9d
commit e46bc4e602
4 changed files with 63 additions and 63 deletions

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 10:35:52 by maldavid #+# #+# */
/* Updated: 2024/02/06 11:40:41 by vvaas ### ########.fr */
/* Updated: 2024/02/06 12:31:53 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -103,7 +103,7 @@ namespace irc
#ifdef DEBUG
logs::report(log_message,"sending '%s'", buffer.c_str());
#endif
if (send(_fd, buffer.c_str(), buffer.length(), 0) < static_cast<ssize_t>(buffer.length()))
if(send(_fd, buffer.c_str(), buffer.length(), 0) < static_cast<ssize_t>(buffer.length()))
logs::report(log_error, "server failed to send a message to '%s'", _nickname.c_str());
}
void Client::printUserHeader() const
@@ -147,8 +147,8 @@ namespace irc
std::string tosend = "Your host is ";
getsockopt(_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &size);
protoent *proto = getprotobynumber(protocol);
if (!isLogged() || !isRegistered() || isWelcomed() || _nickname.empty())
return ;
if(!isLogged() || !isRegistered() || isWelcomed() || _nickname.empty())
return;
_welcomed = true;
gethostname(hostname, 1023);
tosend += hostname;