summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
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/xmpp/xmpp_component.cpp
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/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index eb23087..967614c 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -444,6 +444,24 @@ void XmppComponent::handle_iq(const Stanza& stanza)
else if (type == "result")
{
stanza_error.disable();
+ XmlNode* query;
+ if ((query = stanza.get_child(VERSION_NS":query")))
+ {
+ XmlNode* name_node = query->get_child(VERSION_NS":name");
+ XmlNode* version_node = query->get_child(VERSION_NS":version");
+ XmlNode* os_node = query->get_child(VERSION_NS":os");
+ std::string name;
+ std::string version;
+ std::string os;
+ if (name_node)
+ name = name_node->get_inner() + " (through the biboumi gateway)";
+ if (version_node)
+ version = version_node->get_inner();
+ if (os_node)
+ os = os_node->get_inner();
+ const Iid iid(to.local);
+ bridge->send_xmpp_version_to_irc(iid, name, version, os);
+ }
}
error_type = "cancel";
error_name = "feature-not-implemented";