From 579ca4bdb6b8806d821daa2ee47d60260b64f0f8 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 7 May 2014 02:02:47 +0200 Subject: Forward iq version results to IRC --- src/xmpp/xmpp_component.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/xmpp/xmpp_component.cpp') 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"; -- cgit v1.2.3