summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp5
-rw-r--r--src/bridge/bridge.hpp2
2 files changed, 5 insertions, 2 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);
}
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index f192545..1c89bd5 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -83,7 +83,7 @@ public:
void send_irc_nick_change(const Iid& iid, const std::string& new_nick, const std::string& requesting_resource);
void send_irc_kick(const Iid& iid, const std::string& target, const std::string& reason,
const std::string& iq_id, const std::string& to_jid);
- void set_channel_topic(const Iid& iid, const std::string& subject);
+ void set_channel_topic(const Iid& iid, std::string subject);
void send_xmpp_version_to_irc(const Iid& iid, const std::string& name, const std::string& version,
const std::string& os);
void send_irc_ping_result(const Iid& iid, const std::string& id);