Connection may be closed from our side too
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user