aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppByteStreamIq.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-03-03 15:02:38 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-03-03 15:02:38 +0000
commit03b9d777e30bd869e7d53ca5a426f1e153616121 (patch)
tree21b703615784a7349bb0dda4f345e9d00b2f7505 /source/QXmppByteStreamIq.cpp
parentd84a3a8af6333f6a82f9c2840791a1a6cc3d058f (diff)
downloadqxmpp-03b9d777e30bd869e7d53ca5a426f1e153616121.tar.gz
support parsing of additional bytestream IQ attributes
Diffstat (limited to 'source/QXmppByteStreamIq.cpp')
-rw-r--r--source/QXmppByteStreamIq.cpp25
1 files changed, 25 insertions, 0 deletions
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::StreamHost> 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");