diff options
author | louiz’ <louiz@louiz.org> | 2016-10-31 01:38:26 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-10-31 01:39:35 +0100 |
commit | 1d2f20600a937cd00181a2fad055cd9bb56f058e (patch) | |
tree | 9b0cf839d6ce202598471afcb92074e4ebb110e7 | |
parent | fdf336afa017c24eb483f741e4037226f8a08401 (diff) | |
download | biboumi-1d2f20600a937cd00181a2fad055cd9bb56f058e.tar.gz biboumi-1d2f20600a937cd00181a2fad055cd9bb56f058e.tar.bz2 biboumi-1d2f20600a937cd00181a2fad055cd9bb56f058e.tar.xz biboumi-1d2f20600a937cd00181a2fad055cd9bb56f058e.zip |
Handle IRC message 341 (invite confirmation)
-rw-r--r-- | src/irc/irc_client.cpp | 9 | ||||
-rw-r--r-- | src/irc/irc_client.hpp | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 6a87b99..033671e 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -46,6 +46,7 @@ static const std::unordered_map<std::string, {"323", {&IrcClient::on_rpl_listend, {0, 0}}}, {"RPL_NOTOPIC", {&IrcClient::on_empty_topic, {0, 0}}}, {"331", {&IrcClient::on_empty_topic, {0, 0}}}, + {"341", {&IrcClient::on_invited, {3, 0}}}, {"RPL_MOTDSTART", {&IrcClient::empty_motd, {0, 0}}}, {"375", {&IrcClient::empty_motd, {0, 0}}}, {"RPL_MOTD", {&IrcClient::on_motd_line, {2, 0}}}, @@ -709,6 +710,14 @@ void IrcClient::empty_motd(const IrcMessage&) this->motd.erase(); } +void IrcClient::on_invited(const IrcMessage& message) +{ + const std::string& chan_name = message.arguments[2]; + const std::string& invited_nick = message.arguments[1]; + + this->bridge.send_xmpp_message(this->hostname, "", invited_nick + " has been invited to " + chan_name); +} + void IrcClient::on_empty_topic(const IrcMessage& message) { const std::string chan_name = utils::tolower(message.arguments[1]); diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 9f53c3c..1b4d892 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -214,6 +214,10 @@ public: */ void on_empty_topic(const IrcMessage& message); /** + * The IRC server is confirming that the invitation has been forwarded + */ + void on_invited(const IrcMessage& message); + /** * The channel has been completely joined (self presence, topic, all names * received etc), send the self presence and topic to the XMPP user. */ |