aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppBind.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/QXmppBind.cpp')
-rw-r--r--source/QXmppBind.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/QXmppBind.cpp b/source/QXmppBind.cpp
index f7282151..1d37e025 100644
--- a/source/QXmppBind.cpp
+++ b/source/QXmppBind.cpp
@@ -27,6 +27,7 @@
#include "QXmppConstants.h"
#include <QTextStream>
+#include <QXmlStreamWriter>
QXmppBind::QXmppBind(QXmppIq::Type type)
: QXmppIq(type)
@@ -61,18 +62,15 @@ void QXmppBind::setResource(const QString& str)
m_resource = str;
}
-QByteArray QXmppBind::toXmlElementFromChild() const
+void QXmppBind::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
QString data;
QTextStream stream(&data);
- stream << "<bind";
- helperToXmlAddAttribute(stream, "xmlns", ns_bind);
- stream << ">";
- helperToXmlAddElement(stream, "jid", getJid());
- helperToXmlAddElement(stream, "resource", getResource());
- stream << "</bind>";
-
- return data.toAscii();
+ writer->writeStartElement("bind");
+ helperToXmlAddAttribute(writer, "xmlns", ns_bind);
+ helperToXmlAddTextElement(writer, "jid", getJid() );
+ helperToXmlAddTextElement(writer, "resource", getResource());
+ writer->writeEndElement();
}