From 464261d4ed462f5d74507fe4d17bc5f76b5f726d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 11 Apr 2016 17:14:39 +0200 Subject: Support RPL_NOTPIC and 005 --- src/irc/irc_client.cpp | 16 ++++++++++++++++ src/irc/irc_client.hpp | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 0efae04..1150155 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -34,6 +34,7 @@ static const std::unordered_mapbridge.send_xmpp_message(this->hostname, from, message); @@ -690,6 +697,15 @@ void IrcClient::empty_motd(const IrcMessage&) this->motd.erase(); } +void IrcClient::on_empty_topic(const IrcMessage& message) +{ + const std::string chan_name = utils::tolower(message.arguments[message.arguments.size() - 1]); + log_debug("empty topic for " << chan_name); + IrcChannel* channel = this->get_channel(chan_name); + if (channel) + channel->topic.clear(); +} + void IrcClient::on_motd_line(const IrcMessage& message) { const std::string body = message.arguments[1]; diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 628f547..5efecc6 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -143,6 +143,10 @@ public: * http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt */ void on_isupport_message(const IrcMessage& message); + /** + * Does nothing yet. Isn’t that duplicating features from 005? + */ + void on_server_myinfo(const IrcMessage& message); /** * Just empty the motd we kept as a string */ @@ -194,6 +198,10 @@ public: * Save the topic in the IrcChannel */ void on_topic_received(const IrcMessage& message); + /** + * Empty the topic + */ + void on_empty_topic(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. -- cgit v1.2.3