From 03b9d777e30bd869e7d53ca5a426f1e153616121 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Wed, 3 Mar 2010 15:02:38 +0000 Subject: support parsing of additional bytestream IQ attributes --- source/QXmppByteStreamIq.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source/QXmppByteStreamIq.cpp') diff --git a/source/QXmppByteStreamIq.cpp b/source/QXmppByteStreamIq.cpp index 3f9f3ecb..237488cc 100644 --- a/source/QXmppByteStreamIq.cpp +++ b/source/QXmppByteStreamIq.cpp @@ -57,6 +57,16 @@ void QXmppByteStreamIq::StreamHost::setPort(quint16 port) m_port = port; } +QString QXmppByteStreamIq::StreamHost::zeroconf() const +{ + return m_zeroconf; +} + +void QXmppByteStreamIq::StreamHost::setZeroconf(const QString &zeroconf) +{ + m_zeroconf = zeroconf; +} + QXmppByteStreamIq::Mode QXmppByteStreamIq::mode() const { return m_mode; @@ -77,6 +87,16 @@ void QXmppByteStreamIq::setSid(const QString &sid) m_sid = sid; } +QString QXmppByteStreamIq::activate() const +{ + return m_activate; +} + +void QXmppByteStreamIq::setActivate(const QString &activate) +{ + m_activate = activate; +} + QList QXmppByteStreamIq::streamHosts() const { return m_streamHosts; @@ -126,10 +146,12 @@ void QXmppByteStreamIq::parse(QDomElement &element) streamHost.setHost(QHostAddress(hostElement.attribute("host"))); streamHost.setJid(hostElement.attribute("jid")); streamHost.setPort(hostElement.attribute("port").toInt()); + streamHost.setZeroconf(hostElement.attribute("zeroconf")); m_streamHosts.append(streamHost); hostElement = hostElement.nextSiblingElement("streamhost"); } + m_activate = queryElement.firstChildElement("activate").text(); m_streamHostUsed = queryElement.firstChildElement("streamhost-used").attribute("jid"); } @@ -150,8 +172,11 @@ void QXmppByteStreamIq::toXmlElementFromChild(QXmlStreamWriter *writer) const helperToXmlAddAttribute(writer, "host", streamHost.host().toString()); helperToXmlAddAttribute(writer, "jid", streamHost.jid()); helperToXmlAddAttribute(writer, "port", QString::number(streamHost.port())); + helperToXmlAddAttribute(writer, "zeroconf", streamHost.zeroconf()); writer->writeEndElement(); } + if (!m_activate.isEmpty()) + helperToXmlAddTextElement(writer, "activate", m_activate); if (!m_streamHostUsed.isEmpty()) { writer->writeStartElement("streamhost-used"); -- cgit v1.2.3