Connection may be closed from our side too

This commit is contained in:
Florent Le Coz
2015-09-22 03:50:08 +02:00
parent ceec989077
commit 7247228e97
+3 -1
View File
@@ -123,9 +123,11 @@ void IrcClient::on_connected()
void IrcClient::on_connection_close(const std::string& error_msg) void IrcClient::on_connection_close(const std::string& error_msg)
{ {
std::string message = "Connection closed by remote server."; std::string message = "Connection closed";
if (!error_msg.empty()) if (!error_msg.empty())
message += ": " + error_msg; message += ": " + error_msg;
else
message += ".";
const IrcMessage error{"ERROR", {message}}; const IrcMessage error{"ERROR", {message}};
this->on_error(error); this->on_error(error);
log_warning(message); log_warning(message);