diff options
author | louiz’ <louiz@louiz.org> | 2017-04-09 23:03:35 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-04-09 23:05:32 +0200 |
commit | 68d6b829402592d2d7a00e6e7b5013077aaa745c (patch) | |
tree | 445ba11b0129fdc1df294c2d517586a8e12bd069 /src/bridge/bridge.cpp | |
parent | 79b24d7eb5b729c000cce1b56ee1a64d914b9d4e (diff) | |
download | biboumi-68d6b829402592d2d7a00e6e7b5013077aaa745c.tar.gz biboumi-68d6b829402592d2d7a00e6e7b5013077aaa745c.tar.bz2 biboumi-68d6b829402592d2d7a00e6e7b5013077aaa745c.tar.xz biboumi-68d6b829402592d2d7a00e6e7b5013077aaa745c.zip |
Properly handle multiline topics
fix #3254
Diffstat (limited to 'src/bridge/bridge.cpp')
-rw-r--r-- | src/bridge/bridge.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 591e947..f263c3f 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -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); } |