aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppBind.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-06-29 13:39:11 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-06-29 13:39:11 +0000
commit782b7f3e1199d867d7262ae3e6cf08aea9ad0624 (patch)
treebc17d571e833d752577d1e835d87224756d817e5 /source/QXmppBind.cpp
parent7bc846598f17eea663b265e682a016acdac6beca (diff)
downloadqxmpp-782b7f3e1199d867d7262ae3e6cf08aea9ad0624.tar.gz
cleanup & test more IQ handling
Diffstat (limited to 'source/QXmppBind.cpp')
-rw-r--r--source/QXmppBind.cpp11
1 files changed, 6 insertions, 5 deletions
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();
}