From 782b7f3e1199d867d7262ae3e6cf08aea9ad0624 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Tue, 29 Jun 2010 13:39:11 +0000 Subject: cleanup & test more IQ handling --- source/QXmppBind.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/QXmppBind.cpp') diff --git a/source/QXmppBind.cpp b/source/QXmppBind.cpp index 34f326d5..38bb2131 100644 --- a/source/QXmppBind.cpp +++ b/source/QXmppBind.cpp @@ -30,12 +30,11 @@ #include "QXmppUtils.h" #include "QXmppConstants.h" -QXmppBind::QXmppBind(QXmppIq::Type type) - : QXmppIq(type) +QXmppBind::QXmppBind() { } -QXmppBind::QXmppBind(const QString& type) +QXmppBind::QXmppBind(QXmppIq::Type type) : QXmppIq(type) { } @@ -80,8 +79,10 @@ void QXmppBind::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("bind"); helperToXmlAddAttribute(writer, "xmlns", ns_bind); - helperToXmlAddTextElement(writer, "jid", m_jid); - helperToXmlAddTextElement(writer, "resource", m_resource); + if (!m_jid.isEmpty()) + helperToXmlAddTextElement(writer, "jid", m_jid); + if (!m_resource.isEmpty()) + helperToXmlAddTextElement(writer, "resource", m_resource); writer->writeEndElement(); } -- cgit v1.2.3