Properly handle multiline topics

fix #3254
This commit is contained in:
louiz’
2017-04-09 23:05:32 +02:00
parent 79b24d7eb5
commit 68d6b82940
6 changed files with 30 additions and 4 deletions
+4 -1
View File
@@ -684,9 +684,12 @@ void Bridge::send_irc_kick(const Iid& iid, const std::string& target, const std:
this->add_waiting_irc(std::move(cb));
}
void Bridge::set_channel_topic(const Iid& iid, const std::string& subject)
void Bridge::set_channel_topic(const Iid& iid, std::string subject)
{
IrcClient* irc = this->get_irc_client(iid.get_server());
std::string::size_type pos{0};
while ((pos = subject.find('\n', pos)) != std::string::npos)
subject[pos] = ' ';
irc->send_topic_command(iid.get_local(), subject);
}