aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-03 12:51:55 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-03 12:51:55 +0200
commit7dff3ee250cfea98be51843b3f4be1f8f909540f (patch)
tree51d07e7af1cd05bc6701969a1c2b6ac392e58f15 /src/base
parent18a9380db083a9b4d195a337b87b7b3c142d28e9 (diff)
downloadqxmpp-7dff3ee250cfea98be51843b3f4be1f8f909540f.tar.gz
revert previous commit
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppIq.cpp6
-rw-r--r--src/base/QXmppMessage.cpp7
-rw-r--r--src/base/QXmppPresence.cpp8
3 files changed, 15 insertions, 6 deletions
diff --git a/src/base/QXmppIq.cpp b/src/base/QXmppIq.cpp
index 635d5447..351eeca7 100644
--- a/src/base/QXmppIq.cpp
+++ b/src/base/QXmppIq.cpp
@@ -123,10 +123,12 @@ void QXmppIq::toXml( QXmlStreamWriter *xmlWriter ) const
{
xmlWriter->writeStartElement("iq");
- QXmppStanza::toXmlElementFromChild(xmlWriter);
+ helperToXmlAddAttribute(xmlWriter, "id", id());
+ helperToXmlAddAttribute(xmlWriter, "to", to());
+ helperToXmlAddAttribute(xmlWriter, "from", from());
helperToXmlAddAttribute(xmlWriter, "type", iq_types[d->type]);
toXmlElementFromChild(xmlWriter);
-
+ error().toXml(xmlWriter);
xmlWriter->writeEndElement();
}
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp
index 86e808d2..d47233b9 100644
--- a/src/base/QXmppMessage.cpp
+++ b/src/base/QXmppMessage.cpp
@@ -382,8 +382,10 @@ void QXmppMessage::parse(const QDomElement &element)
void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const
{
xmlWriter->writeStartElement("message");
- QXmppStanza::toXmlElementFromChild(xmlWriter);
-
+ helperToXmlAddAttribute(xmlWriter, "xml:lang", lang());
+ helperToXmlAddAttribute(xmlWriter, "id", id());
+ helperToXmlAddAttribute(xmlWriter, "to", to());
+ helperToXmlAddAttribute(xmlWriter, "from", from());
helperToXmlAddAttribute(xmlWriter, "type", message_types[d->type]);
if (!d->subject.isEmpty())
helperToXmlAddTextElement(xmlWriter, "subject", d->subject);
@@ -391,6 +393,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const
helperToXmlAddTextElement(xmlWriter, "body", d->body);
if (!d->thread.isEmpty())
helperToXmlAddTextElement(xmlWriter, "thread", d->thread);
+ error().toXml(xmlWriter);
// chat states
if (d->state > None && d->state <= Paused)
diff --git a/src/base/QXmppPresence.cpp b/src/base/QXmppPresence.cpp
index 83f8081d..4c33590e 100644
--- a/src/base/QXmppPresence.cpp
+++ b/src/base/QXmppPresence.cpp
@@ -260,11 +260,15 @@ void QXmppPresence::parse(const QDomElement &element)
void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const
{
xmlWriter->writeStartElement("presence");
- QXmppStanza::toXmlElementFromChild(xmlWriter);
-
+ helperToXmlAddAttribute(xmlWriter,"xml:lang", lang());
+ helperToXmlAddAttribute(xmlWriter,"id", id());
+ helperToXmlAddAttribute(xmlWriter,"to", to());
+ helperToXmlAddAttribute(xmlWriter,"from", from());
helperToXmlAddAttribute(xmlWriter,"type", presence_types[d->type]);
d->status.toXml(xmlWriter);
+ error().toXml(xmlWriter);
+
// XEP-0045: Multi-User Chat
if(!d->mucItem.isNull() || !d->mucStatusCodes.isEmpty())
{