diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-07-15 15:39:25 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-07-15 15:39:25 +0200 |
commit | 11a31db2d5bcc158bb8902e74f192dbc82827f53 (patch) | |
tree | 045aa047a7a63c80c501d9f8be30e3cb2ac95ce8 /src/irc/irc_client.cpp | |
parent | 4582f1079767f53bb6bd9b96c358ea3c641aaa96 (diff) | |
download | biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.gz biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.bz2 biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.xz biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.zip |
Send the reason of the connection close to the user
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r-- | src/irc/irc_client.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 6468094..e518ffc 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -93,9 +93,11 @@ void IrcClient::on_connected() this->send_pending_data(); } -void IrcClient::on_connection_close() +void IrcClient::on_connection_close(const std::string& error_msg) { - static const std::string message = "Connection closed by remote server."; + std::string message = "Connection closed by remote server."; + if (!error_msg.empty()) + message += ": " + error_msg; const IrcMessage error{"ERROR", {message}}; this->on_error(error); log_warning(message); |