From 17288d3fe3c6a6f08e7585111bdc92febd84c8f4 Mon Sep 17 00:00:00 2001 From: mochaoui Date: Tue, 30 Apr 2024 20:26:31 +0100 Subject: [PATCH] fix the server host msg for the irssi client now the login msg is clean --- Server.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Server.cpp b/Server.cpp index efcf30a..3918df5 100644 --- a/Server.cpp +++ b/Server.cpp @@ -556,7 +556,7 @@ void Server::handleClientData(int fd) } // Validate the password - if (passwordLine.empty()) + if (passwordLine.empty()) { std::string errorMessage = "Error: Password cannot be empty\n"; send(fd, errorMessage.c_str(), errorMessage.length(), 0); @@ -977,12 +977,9 @@ void Server::handleClientData(int fd) std::istringstream iss(command.substr(5)); iss >> channelName >> mode >> nick; if (channelName[0] != '#') - { - std::string errorMessage = ":server.host NOTICE " + nick + " :Error: Channel start with #\r\n"; - send(fd, errorMessage.c_str(), errorMessage.length(), 0); + { client.clearCommand(); return; - } channelName = channelName.substr(1); channelName = trim(channelName);