From 0a6b673b14efc4f623ea445045e6fc60e9842a25 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 7 May 2015 17:01:17 +0200 Subject: Support raw IRC messages Messages received on an IRC server JID are forwarded as raw IRC messages. fix #2486 --- src/bridge/bridge.cpp | 11 +++++++++++ src/bridge/bridge.hpp | 1 + 2 files changed, 12 insertions(+) (limited to 'src/bridge') diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 85049b9..45cdc01 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -273,6 +273,17 @@ void Bridge::send_private_message(const Iid& iid, const std::string& body, const } } +void Bridge::send_raw_message(const std::string& hostname, const std::string& body) +{ + IrcClient* irc = this->get_irc_client(hostname); + if (!irc) + { + log_warning("Cannot send message: no client exist for server " << hostname); + return ; + } + irc->send_raw(body); +} + void Bridge::leave_irc_channel(Iid&& iid, std::string&& status_message) { IrcClient* irc = this->get_irc_client(iid.get_server()); diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index c50b7ab..cc9d042 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -61,6 +61,7 @@ public: bool join_irc_channel(const Iid& iid, const std::string& username, const std::string& password); void send_channel_message(const Iid& iid, const std::string& body); void send_private_message(const Iid& iid, const std::string& body, const std::string& type="PRIVMSG"); + void send_raw_message(const std::string& hostname, const std::string& body); void leave_irc_channel(Iid&& iid, std::string&& status_message); void send_irc_nick_change(const Iid& iid, const std::string& new_nick); void send_irc_kick(const Iid& iid, const std::string& target, const std::string& reason, -- cgit v1.2.3