Handle topic changes
This commit is contained in:
@@ -274,6 +274,8 @@ void IrcClient::on_topic_received(const IrcMessage& message)
|
|||||||
const std::string chan_name = utils::tolower(message.arguments[1]);
|
const std::string chan_name = utils::tolower(message.arguments[1]);
|
||||||
IrcChannel* channel = this->get_channel(chan_name);
|
IrcChannel* channel = this->get_channel(chan_name);
|
||||||
channel->topic = message.arguments[2];
|
channel->topic = message.arguments[2];
|
||||||
|
if (channel->joined)
|
||||||
|
this->bridge->send_topic(this->hostname, chan_name, channel->topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IrcClient::on_channel_completely_joined(const IrcMessage& message)
|
void IrcClient::on_channel_completely_joined(const IrcMessage& message)
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ static const std::unordered_map<std::string, irc_callback_t> irc_callbacks = {
|
|||||||
{"PRIVMSG", &IrcClient::on_channel_message},
|
{"PRIVMSG", &IrcClient::on_channel_message},
|
||||||
{"353", &IrcClient::set_and_forward_user_list},
|
{"353", &IrcClient::set_and_forward_user_list},
|
||||||
{"332", &IrcClient::on_topic_received},
|
{"332", &IrcClient::on_topic_received},
|
||||||
|
{"TOPIC", &IrcClient::on_topic_received},
|
||||||
{"366", &IrcClient::on_channel_completely_joined},
|
{"366", &IrcClient::on_channel_completely_joined},
|
||||||
{"001", &IrcClient::on_welcome_message},
|
{"001", &IrcClient::on_welcome_message},
|
||||||
{"PART", &IrcClient::on_part},
|
{"PART", &IrcClient::on_part},
|
||||||
|
|||||||
Reference in New Issue
Block a user