summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc_client.cpp12
-rw-r--r--src/irc/irc_client.hpp1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 6d4df4a..e4b6377 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -75,6 +75,7 @@ static const std::unordered_map<std::string,
{"PING", {&IrcClient::send_pong_command, {1, 0}}},
{"PONG", {&IrcClient::on_pong, {0, 0}}},
{"KICK", {&IrcClient::on_kick, {3, 0}}},
+ {"INVITE", {&IrcClient::on_invite, {2, 0}}},
{"401", {&IrcClient::on_generic_error, {2, 0}}},
{"402", {&IrcClient::on_generic_error, {2, 0}}},
@@ -971,6 +972,17 @@ void IrcClient::on_kick(const IrcMessage& message)
this->bridge.kick_muc_user(std::move(iid), target, reason, author.nick);
}
+void IrcClient::on_invite(const IrcMessage& message)
+{
+ const std::string& author = message.arguments[0];
+ Iid iid;
+ iid.set_local(message.arguments[1]);
+ iid.set_server(this->hostname);
+ iid.type = Iid::Type::Channel;
+
+ this->bridge.send_xmpp_invitation(iid, author);
+}
+
void IrcClient::on_mode(const IrcMessage& message)
{
const std::string target = message.arguments[0];
diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp
index 6fa40ce..9f53c3c 100644
--- a/src/irc/irc_client.hpp
+++ b/src/irc/irc_client.hpp
@@ -249,6 +249,7 @@ public:
void on_welcome_message(const IrcMessage& message);
void on_part(const IrcMessage& message);
void on_error(const IrcMessage& message);
+ void on_invite(const IrcMessage& message);
void on_nick(const IrcMessage& message);
void on_kick(const IrcMessage& message);
void on_mode(const IrcMessage& message);