summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-07 02:02:47 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-07 02:02:47 +0200
commit579ca4bdb6b8806d821daa2ee47d60260b64f0f8 (patch)
tree769ea0ec97757f94eb3e6b2d1d50e504a8b868a9 /src/bridge
parent04fe15a1e78e2bb20e490b15d45853328545c97d (diff)
downloadbiboumi-579ca4bdb6b8806d821daa2ee47d60260b64f0f8.tar.gz
biboumi-579ca4bdb6b8806d821daa2ee47d60260b64f0f8.tar.bz2
biboumi-579ca4bdb6b8806d821daa2ee47d60260b64f0f8.tar.xz
biboumi-579ca4bdb6b8806d821daa2ee47d60260b64f0f8.zip
Forward iq version results to IRC
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp11
-rw-r--r--src/bridge/bridge.hpp3
2 files changed, 11 insertions, 3 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 6c85722..f9dc9a6 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -170,13 +170,13 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body)
this->make_xmpp_body(body), this->user_jid);
}
-void Bridge::send_private_message(const Iid& iid, const std::string& body)
+void Bridge::send_private_message(const Iid& iid, const std::string& body, const std::string& type)
{
if (iid.chan.empty() || iid.server.empty())
return ;
IrcClient* irc = this->get_irc_client(iid.server);
if (irc)
- irc->send_private_message(iid.chan, body);
+ irc->send_private_message(iid.chan, body, type);
}
void Bridge::leave_irc_channel(Iid&& iid, std::string&& status_message)
@@ -207,6 +207,13 @@ void Bridge::set_channel_topic(const Iid& iid, const std::string& subject)
irc->send_topic_command(iid.chan, subject);
}
+void Bridge::send_xmpp_version_to_irc(const Iid& iid, const std::string& name, const std::string& version, const std::string& os)
+{
+ std::string result(name + " " + version + " " + os);
+
+ this->send_private_message(iid, "\01VERSION "s + result + "\01", "NOTICE");
+}
+
void Bridge::send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc)
{
if (muc)
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index f2da8d7..d0fd5bd 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -45,11 +45,12 @@ public:
*/
bool join_irc_channel(const Iid& iid, const std::string& username);
void send_channel_message(const Iid& iid, const std::string& body);
- void send_private_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 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);
void set_channel_topic(const Iid& iid, const std::string& subject);
+ void send_xmpp_version_to_irc(const Iid& iid, const std::string& name, const std::string& version, const std::string& os);
/***
**