diff options
Diffstat (limited to 'src/irc/irc_client.hpp')
-rw-r--r-- | src/irc/irc_client.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 99ee6c0..e695e53 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -100,6 +100,12 @@ public: */ void send_quit_command(); /** + * Send a message to the gateway user, not generated by the IRC server, + * but that might be useful because we want to be verbose (for example we + * might want to notify the user about the connexion state) + */ + void send_gateway_message(const std::string& message, const std::string& from=""); + /** * Forward the server message received from IRC to the XMPP component */ void forward_server_message(const IrcMessage& message); @@ -139,6 +145,14 @@ public: */ void on_channel_completely_joined(const IrcMessage& message); /** + * We tried to set an invalid nickname + */ + void on_erroneous_nickname(const IrcMessage& message); + /** + * Handles most errors from the server by just forwarding the message to the user. + */ + void on_generic_error(const IrcMessage& message); + /** * When a message 001 is received, join the rooms we wanted to join, and set our actual nickname */ void on_welcome_message(const IrcMessage& message); @@ -208,6 +222,8 @@ typedef void (IrcClient::*irc_callback_t)(const IrcMessage&); static const std::unordered_map<std::string, irc_callback_t> irc_callbacks = { {"NOTICE", &IrcClient::forward_server_message}, + {"002", &IrcClient::forward_server_message}, + {"003", &IrcClient::forward_server_message}, {"RPL_MOTDSTART", &IrcClient::empty_motd}, {"375", &IrcClient::empty_motd}, {"RPL_MOTD", &IrcClient::on_motd_line}, @@ -220,6 +236,8 @@ static const std::unordered_map<std::string, irc_callback_t> irc_callbacks = { {"332", &IrcClient::on_topic_received}, {"TOPIC", &IrcClient::on_topic_received}, {"366", &IrcClient::on_channel_completely_joined}, + {"432", &IrcClient::on_erroneous_nickname}, + {"461", &IrcClient::on_generic_error}, {"001", &IrcClient::on_welcome_message}, {"PART", &IrcClient::on_part}, {"ERROR", &IrcClient::on_error}, |