aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-03-11 13:42:36 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-03-11 13:42:36 +0000
commit70e4aa086ce5d30fc683fd862e5fc324ba738d32 (patch)
treeb3c8ad632bd3426b38f37a9353f529836b54b44b
parent024948b71f947c1b6c8b516b40dfdacdc647e2c9 (diff)
downloadqxmpp-70e4aa086ce5d30fc683fd862e5fc324ba738d32.tar.gz
add "node" property to QXmppDiscoveryIq
-rw-r--r--source/QXmppDiscoveryIq.cpp12
-rw-r--r--source/QXmppDiscoveryIq.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/source/QXmppDiscoveryIq.cpp b/source/QXmppDiscoveryIq.cpp
index 36052dd6..c3f3f9cc 100644
--- a/source/QXmppDiscoveryIq.cpp
+++ b/source/QXmppDiscoveryIq.cpp
@@ -37,6 +37,16 @@ void QXmppDiscoveryIq::setQueryItems(const QXmppElementList &items)
m_queryItems = items;
}
+QString QXmppDiscoveryIq::queryNode() const
+{
+ return m_queryNode;
+}
+
+void QXmppDiscoveryIq::setQueryNode(const QString &node)
+{
+ m_queryNode = node;
+}
+
enum QXmppDiscoveryIq::QueryType QXmppDiscoveryIq::queryType() const
{
return m_queryType;
@@ -60,6 +70,7 @@ void QXmppDiscoveryIq::parse(const QDomElement &element)
setTypeFromStr(element.attribute("type"));
QDomElement queryElement = element.firstChildElement("query");
+ m_queryNode = queryElement.attribute("node");
if (queryElement.namespaceURI() == ns_disco_items)
m_queryType = ItemsQuery;
else
@@ -78,6 +89,7 @@ void QXmppDiscoveryIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
writer->writeStartElement("query");
helperToXmlAddAttribute(writer, "xmlns",
m_queryType == InfoQuery ? ns_disco_info : ns_disco_items);
+ helperToXmlAddAttribute(writer, "node", m_queryNode);
foreach (const QXmppElement &item, m_queryItems)
item.toXml(writer);
writer->writeEndElement();
diff --git a/source/QXmppDiscoveryIq.h b/source/QXmppDiscoveryIq.h
index 76eabca1..cc4f556c 100644
--- a/source/QXmppDiscoveryIq.h
+++ b/source/QXmppDiscoveryIq.h
@@ -40,6 +40,9 @@ public:
QXmppElementList queryItems() const;
void setQueryItems(const QXmppElementList &items);
+ QString queryNode() const;
+ void setQueryNode(const QString &node);
+
enum QueryType queryType() const;
void setQueryType(enum QueryType type);
@@ -49,6 +52,7 @@ public:
private:
QXmppElementList m_queryItems;
+ QString m_queryNode;
enum QueryType m_queryType;
};