aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppInformationRequestResult.cpp
diff options
context:
space:
mode:
authorManjeet Dahiya <manjeetdahiya@gmail.com>2009-10-20 11:43:45 +0000
committerManjeet Dahiya <manjeetdahiya@gmail.com>2009-10-20 11:43:45 +0000
commite2be03e254a956024c9d67b19b8a809c9692b6f1 (patch)
tree4da3e5da19d109bf34d02ed9359065c73be176ab /source/QXmppInformationRequestResult.cpp
parenta9d542be47e91ae39390247f8c8bbb21d588388f (diff)
downloadqxmpp-e2be03e254a956024c9d67b19b8a809c9692b6f1.tar.gz
Using QXmlStreamWriter for directly writing to the socket. This will avoid string concatenations and problems with XML escaping rules.
and Fix for Issue 19: XMPP Version < 1.0 send NonSASL Auth query
Diffstat (limited to 'source/QXmppInformationRequestResult.cpp')
-rw-r--r--source/QXmppInformationRequestResult.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/source/QXmppInformationRequestResult.cpp b/source/QXmppInformationRequestResult.cpp
index 86236ff6..058612f1 100644
--- a/source/QXmppInformationRequestResult.cpp
+++ b/source/QXmppInformationRequestResult.cpp
@@ -1,24 +1,20 @@
#include "QXmppInformationRequestResult.h"
#include "QXmppConstants.h"
+#include <QXmlStreamWriter>
QXmppInformationRequestResult::QXmppInformationRequestResult() : QXmppIq(QXmppIq::Result)
{
}
-QByteArray QXmppInformationRequestResult::toXmlElementFromChild() const
+void QXmppInformationRequestResult::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
- QByteArray resultXml;
-
- resultXml += "<query xmlns='";
- resultXml += ns_disco_info;
- resultXml += "'>";
- resultXml += "<feature var='";
- resultXml += ns_disco_info;
- resultXml += "'/>";
- resultXml += "<feature var='";
- resultXml += ns_ibb;
- resultXml += "'/>";
- resultXml += "</query>";
-
- return resultXml;
+ writer->writeStartElement("query");
+ writer->writeAttribute("xmlns", ns_disco_info );
+ writer->writeStartElement("feature");
+ writer->writeAttribute("var", ns_disco_info );
+ writer->writeEndElement();
+ writer->writeStartElement("feature");
+ writer->writeAttribute("var", ns_ibb );
+ writer->writeEndElement();
+ writer->writeEndElement();
}