diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-03-03 15:02:38 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-03-03 15:02:38 +0000 |
| commit | 03b9d777e30bd869e7d53ca5a426f1e153616121 (patch) | |
| tree | 21b703615784a7349bb0dda4f345e9d00b2f7505 /source | |
| parent | d84a3a8af6333f6a82f9c2840791a1a6cc3d058f (diff) | |
| download | qxmpp-03b9d777e30bd869e7d53ca5a426f1e153616121.tar.gz | |
support parsing of additional bytestream IQ attributes
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppByteStreamIq.cpp | 25 | ||||
| -rw-r--r-- | source/QXmppByteStreamIq.h | 9 |
2 files changed, 34 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"); diff --git a/source/QXmppByteStreamIq.h b/source/QXmppByteStreamIq.h index 294e2710..9f3390e0 100644 --- a/source/QXmppByteStreamIq.h +++ b/source/QXmppByteStreamIq.h @@ -52,10 +52,14 @@ public: quint16 port() const; void setPort(quint16 port); + QString zeroconf() const; + void setZeroconf(const QString &zeroconf); + private: QHostAddress m_host; QString m_jid; quint16 m_port; + QString m_zeroconf; }; QXmppByteStreamIq::Mode mode() const; @@ -64,6 +68,9 @@ public: QString sid() const; void setSid(const QString &sid); + QString activate() const; + void setActivate(const QString &activate); + QList<QXmppByteStreamIq::StreamHost> streamHosts() const; void setStreamHosts(const QList<QXmppByteStreamIq::StreamHost> &streamHosts); @@ -77,6 +84,8 @@ public: private: Mode m_mode; QString m_sid; + + QString m_activate; QList<StreamHost> m_streamHosts; QString m_streamHostUsed; }; |
