summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index d179aaa..e518ffc 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -20,7 +20,7 @@ using namespace std::string_literals;
using namespace std::chrono_literals;
IrcClient::IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& username, Bridge* bridge):
- SocketHandler(poller),
+ TCPSocketHandler(poller),
hostname(hostname),
username(username),
current_nick(username),
@@ -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);