diff options
| author | Linus Jahn <lnj@kaidan.im> | 2020-01-29 18:30:46 +0100 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2020-01-29 19:11:49 +0100 |
| commit | 7472d8d86a1da384104690db2a22977dcc135e24 (patch) | |
| tree | 14c749a5f2b68d9fd62949f8643f3e40eaa12151 | |
| parent | 0a074f6baa11970686c0fdb63903cd167bf3945a (diff) | |
Replace manual xmlns writing by writeDefaultNamespace()
This is the result of:
sed -i 's/writeAttribute("xmlns", /writeDefaultNamespace(/g' \
$(find . -iname "*.cpp" -or -iname "*.h")
36 files changed, 90 insertions, 90 deletions
diff --git a/src/base/QXmppArchiveIq.cpp b/src/base/QXmppArchiveIq.cpp index 34b73b50..de3fbed8 100644 --- a/src/base/QXmppArchiveIq.cpp +++ b/src/base/QXmppArchiveIq.cpp @@ -114,7 +114,7 @@ void QXmppArchiveChat::parse(const QDomElement &element) void QXmppArchiveChat::toXml(QXmlStreamWriter *writer, const QXmppResultSetReply &rsm) const { writer->writeStartElement("chat"); - writer->writeAttribute("xmlns", ns_archive); + writer->writeDefaultNamespace(ns_archive); helperToXmlAddAttribute(writer, "with", m_with); if (m_start.isValid()) helperToXmlAddAttribute(writer, "start", QXmppUtils::datetimeToString(m_start)); @@ -416,7 +416,7 @@ void QXmppArchiveListIq::parseElementFromChild(const QDomElement &element) void QXmppArchiveListIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("list"); - writer->writeAttribute("xmlns", ns_archive); + writer->writeDefaultNamespace(ns_archive); if (!m_with.isEmpty()) helperToXmlAddAttribute(writer, "with", m_with); if (m_start.isValid()) @@ -447,7 +447,7 @@ void QXmppArchivePrefIq::parseElementFromChild(const QDomElement &element) void QXmppArchivePrefIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("pref"); - writer->writeAttribute("xmlns", ns_archive); + writer->writeDefaultNamespace(ns_archive); writer->writeEndElement(); } /// \endcond @@ -521,7 +521,7 @@ void QXmppArchiveRemoveIq::parseElementFromChild(const QDomElement &element) void QXmppArchiveRemoveIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("remove"); - writer->writeAttribute("xmlns", ns_archive); + writer->writeDefaultNamespace(ns_archive); if (!m_with.isEmpty()) helperToXmlAddAttribute(writer, "with", m_with); if (m_start.isValid()) @@ -608,7 +608,7 @@ void QXmppArchiveRetrieveIq::parseElementFromChild(const QDomElement &element) void QXmppArchiveRetrieveIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("retrieve"); - writer->writeAttribute("xmlns", ns_archive); + writer->writeDefaultNamespace(ns_archive); helperToXmlAddAttribute(writer, "with", m_with); helperToXmlAddAttribute(writer, "start", QXmppUtils::datetimeToString(m_start)); if (!m_rsmQuery.isNull()) diff --git a/src/base/QXmppBindIq.cpp b/src/base/QXmppBindIq.cpp index 1e1bfa51..b0351980 100644 --- a/src/base/QXmppBindIq.cpp +++ b/src/base/QXmppBindIq.cpp @@ -81,7 +81,7 @@ void QXmppBindIq::parseElementFromChild(const QDomElement &element) void QXmppBindIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("bind"); - writer->writeAttribute("xmlns", ns_bind); + writer->writeDefaultNamespace(ns_bind); if (!m_jid.isEmpty()) helperToXmlAddTextElement(writer, "jid", m_jid); if (!m_resource.isEmpty()) diff --git a/src/base/QXmppBitsOfBinaryData.cpp b/src/base/QXmppBitsOfBinaryData.cpp index 503eabc0..f3eba9cb 100644 --- a/src/base/QXmppBitsOfBinaryData.cpp +++ b/src/base/QXmppBitsOfBinaryData.cpp @@ -148,7 +148,7 @@ void QXmppBitsOfBinaryData::parseElementFromChild(const QDomElement &dataElement void QXmppBitsOfBinaryData::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("data"); - writer->writeAttribute("xmlns", ns_bob); + writer->writeDefaultNamespace(ns_bob); helperToXmlAddAttribute(writer, "cid", d->cid.toContentId()); if (d->maxAge > -1) helperToXmlAddAttribute(writer, "max-age", QString::number(d->maxAge)); diff --git a/src/base/QXmppBookmarkSet.cpp b/src/base/QXmppBookmarkSet.cpp index a47234b2..e70adcc6 100644 --- a/src/base/QXmppBookmarkSet.cpp +++ b/src/base/QXmppBookmarkSet.cpp @@ -209,7 +209,7 @@ void QXmppBookmarkSet::parse(const QDomElement &element) void QXmppBookmarkSet::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("storage"); - writer->writeAttribute("xmlns", ns_bookmarks); + writer->writeDefaultNamespace(ns_bookmarks); for (const auto &conference : m_conferences) { writer->writeStartElement("conference"); if (conference.autoJoin()) diff --git a/src/base/QXmppByteStreamIq.cpp b/src/base/QXmppByteStreamIq.cpp index 29f008a2..92709b4d 100644 --- a/src/base/QXmppByteStreamIq.cpp +++ b/src/base/QXmppByteStreamIq.cpp @@ -154,7 +154,7 @@ void QXmppByteStreamIq::parseElementFromChild(const QDomElement &element) void QXmppByteStreamIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_bytestreams); + writer->writeDefaultNamespace(ns_bytestreams); helperToXmlAddAttribute(writer, "sid", m_sid); QString modeStr; if (m_mode == Tcp) diff --git a/src/base/QXmppDataForm.cpp b/src/base/QXmppDataForm.cpp index 7e39236f..7face338 100644 --- a/src/base/QXmppDataForm.cpp +++ b/src/base/QXmppDataForm.cpp @@ -750,7 +750,7 @@ void QXmppDataForm::toXml(QXmlStreamWriter *writer) const return; writer->writeStartElement("x"); - writer->writeAttribute("xmlns", ns_data); + writer->writeDefaultNamespace(ns_data); /* form type */ QString typeStr; diff --git a/src/base/QXmppDiscoveryIq.cpp b/src/base/QXmppDiscoveryIq.cpp index ef8baa6f..6524e81f 100644 --- a/src/base/QXmppDiscoveryIq.cpp +++ b/src/base/QXmppDiscoveryIq.cpp @@ -306,7 +306,7 @@ void QXmppDiscoveryIq::parseElementFromChild(const QDomElement &element) void QXmppDiscoveryIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", + writer->writeDefaultNamespace( m_queryType == InfoQuery ? ns_disco_info : ns_disco_items); helperToXmlAddAttribute(writer, "node", m_queryNode); diff --git a/src/base/QXmppElement.cpp b/src/base/QXmppElement.cpp index 7570dbcf..fbf8762c 100644 --- a/src/base/QXmppElement.cpp +++ b/src/base/QXmppElement.cpp @@ -237,7 +237,7 @@ void QXmppElement::toXml(QXmlStreamWriter *writer) const writer->writeStartElement(d->name); if (d->attributes.contains("xmlns")) - writer->writeAttribute("xmlns", d->attributes.value("xmlns")); + writer->writeDefaultNamespace(d->attributes.value("xmlns")); for (const auto &attr : d->attributes.keys()) if (attr != "xmlns") helperToXmlAddAttribute(writer, attr, d->attributes.value(attr)); diff --git a/src/base/QXmppEntityTimeIq.cpp b/src/base/QXmppEntityTimeIq.cpp index 17da460a..9dad7ce0 100644 --- a/src/base/QXmppEntityTimeIq.cpp +++ b/src/base/QXmppEntityTimeIq.cpp @@ -80,7 +80,7 @@ void QXmppEntityTimeIq::parseElementFromChild(const QDomElement &element) void QXmppEntityTimeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("time"); - writer->writeAttribute("xmlns", ns_entity_time); + writer->writeDefaultNamespace(ns_entity_time); if(m_utc.isValid()) { diff --git a/src/base/QXmppHttpUploadIq.cpp b/src/base/QXmppHttpUploadIq.cpp index 82432d7b..932f5504 100644 --- a/src/base/QXmppHttpUploadIq.cpp +++ b/src/base/QXmppHttpUploadIq.cpp @@ -119,7 +119,7 @@ void QXmppHttpUploadRequestIq::parseElementFromChild(const QDomElement &element) void QXmppHttpUploadRequestIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("request"); - writer->writeAttribute("xmlns", ns_http_upload); + writer->writeDefaultNamespace(ns_http_upload); // filename and size are required writer->writeAttribute("filename", d->fileName); writer->writeAttribute("size", QString::number(d->size)); @@ -231,7 +231,7 @@ void QXmppHttpUploadSlotIq::parseElementFromChild(const QDomElement &element) void QXmppHttpUploadSlotIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("slot"); - writer->writeAttribute("xmlns", ns_http_upload); + writer->writeDefaultNamespace(ns_http_upload); writer->writeStartElement("put"); writer->writeAttribute("url", d->putUrl.toEncoded()); diff --git a/src/base/QXmppIbbIq.cpp b/src/base/QXmppIbbIq.cpp index dbe3ab97..7f79140b 100644 --- a/src/base/QXmppIbbIq.cpp +++ b/src/base/QXmppIbbIq.cpp @@ -70,7 +70,7 @@ void QXmppIbbOpenIq::parseElementFromChild(const QDomElement &element) void QXmppIbbOpenIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("open"); - writer->writeAttribute( "xmlns",ns_ibb); + writer->writeDefaultNamespace(ns_ibb); writer->writeAttribute( "sid",m_sid); writer->writeAttribute( "block-size",QString::number(m_block_size) ); writer->writeEndElement(); @@ -108,7 +108,7 @@ void QXmppIbbCloseIq::parseElementFromChild(const QDomElement &element) void QXmppIbbCloseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("close"); - writer->writeAttribute( "xmlns",ns_ibb); + writer->writeDefaultNamespace(ns_ibb); writer->writeAttribute( "sid",m_sid); writer->writeEndElement(); } @@ -166,7 +166,7 @@ void QXmppIbbDataIq::parseElementFromChild(const QDomElement &element) void QXmppIbbDataIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("data"); - writer->writeAttribute( "xmlns",ns_ibb); + writer->writeDefaultNamespace(ns_ibb); writer->writeAttribute( "sid",m_sid); writer->writeAttribute( "seq",QString::number(m_seq) ); writer->writeCharacters( m_payload.toBase64() ); diff --git a/src/base/QXmppJingleIq.cpp b/src/base/QXmppJingleIq.cpp index 3acdca6a..4c0be456 100644 --- a/src/base/QXmppJingleIq.cpp +++ b/src/base/QXmppJingleIq.cpp @@ -422,7 +422,7 @@ void QXmppJingleIq::Content::toXml(QXmlStreamWriter *writer) const if (!d->descriptionType.isEmpty() || !d->payloadTypes.isEmpty()) { writer->writeStartElement("description"); - writer->writeAttribute("xmlns", d->descriptionType); + writer->writeDefaultNamespace(d->descriptionType); helperToXmlAddAttribute(writer, "media", d->descriptionMedia); if (d->descriptionSsrc) writer->writeAttribute("ssrc", QString::number(d->descriptionSsrc)); @@ -435,7 +435,7 @@ void QXmppJingleIq::Content::toXml(QXmlStreamWriter *writer) const if (!d->transportType.isEmpty() || !d->transportCandidates.isEmpty()) { writer->writeStartElement("transport"); - writer->writeAttribute("xmlns", d->transportType); + writer->writeDefaultNamespace(d->transportType); helperToXmlAddAttribute(writer, "ufrag", d->transportUser); helperToXmlAddAttribute(writer, "pwd", d->transportPassword); for (const auto &candidate : d->transportCandidates) @@ -444,7 +444,7 @@ void QXmppJingleIq::Content::toXml(QXmlStreamWriter *writer) const // XEP-0320 if (!d->transportFingerprint.isEmpty() && !d->transportFingerprintHash.isEmpty()) { writer->writeStartElement("fingerprint"); - writer->writeAttribute("xmlns", ns_jingle_dtls); + writer->writeDefaultNamespace(ns_jingle_dtls); writer->writeAttribute("hash", d->transportFingerprintHash); writer->writeAttribute("setup", d->transportFingerprintSetup); writer->writeCharacters(formatFingerprint(d->transportFingerprint)); @@ -902,7 +902,7 @@ void QXmppJingleIq::parseElementFromChild(const QDomElement &element) void QXmppJingleIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("jingle"); - writer->writeAttribute("xmlns", ns_jingle); + writer->writeDefaultNamespace(ns_jingle); helperToXmlAddAttribute(writer, "action", jingle_actions[d->action]); helperToXmlAddAttribute(writer, "initiator", d->initiator); helperToXmlAddAttribute(writer, "responder", d->responder); @@ -914,7 +914,7 @@ void QXmppJingleIq::toXmlElementFromChild(QXmlStreamWriter *writer) const // ringing if (d->ringing) { writer->writeStartElement("ringing"); - writer->writeAttribute("xmlns", ns_jingle_rtp_info); + writer->writeDefaultNamespace(ns_jingle_rtp_info); writer->writeEndElement(); } diff --git a/src/base/QXmppMamIq.cpp b/src/base/QXmppMamIq.cpp index cb50cdd4..c2a719e4 100644 --- a/src/base/QXmppMamIq.cpp +++ b/src/base/QXmppMamIq.cpp @@ -116,7 +116,7 @@ void QXmppMamQueryIq::parseElementFromChild(const QDomElement &element) void QXmppMamQueryIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_mam); + writer->writeDefaultNamespace(ns_mam); if (!m_node.isEmpty()) { writer->writeAttribute("node", m_node); } @@ -185,7 +185,7 @@ void QXmppMamResultIq::parseElementFromChild(const QDomElement &element) void QXmppMamResultIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("fin"); - writer->writeAttribute("xmlns", ns_mam); + writer->writeDefaultNamespace(ns_mam); if (m_complete) { writer->writeAttribute("complete", "true"); } diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp index f11a9cb5..4f50b836 100644 --- a/src/base/QXmppMessage.cpp +++ b/src/base/QXmppMessage.cpp @@ -849,16 +849,16 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // chat states if (d->state > None && d->state <= Paused) { xmlWriter->writeStartElement(CHAT_STATES.at(d->state)); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_chat_states); + xmlWriter->writeDefaultNamespace(ns_chat_states); xmlWriter->writeEndElement(); } // XEP-0071: XHTML-IM if (!d->xhtml.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("html")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_xhtml_im); + xmlWriter->writeDefaultNamespace(ns_xhtml_im); xmlWriter->writeStartElement(QStringLiteral("body")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_xhtml); + xmlWriter->writeDefaultNamespace(ns_xhtml); xmlWriter->writeCharacters(QStringLiteral("")); xmlWriter->device()->write(d->xhtml.toUtf8()); xmlWriter->writeEndElement(); @@ -871,13 +871,13 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const if (d->stampType == DelayedDelivery) { // XEP-0203: Delayed Delivery xmlWriter->writeStartElement(QStringLiteral("delay")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_delayed_delivery); + xmlWriter->writeDefaultNamespace(ns_delayed_delivery); helperToXmlAddAttribute(xmlWriter, QStringLiteral("stamp"), QXmppUtils::datetimeToString(utcStamp)); xmlWriter->writeEndElement(); } else { // XEP-0091: Legacy Delayed Delivery xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_legacy_delayed_delivery); + xmlWriter->writeDefaultNamespace(ns_legacy_delayed_delivery); helperToXmlAddAttribute(xmlWriter, QStringLiteral("stamp"), utcStamp.toString(QStringLiteral("yyyyMMddThh:mm:ss"))); xmlWriter->writeEndElement(); } @@ -886,27 +886,27 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0184: Message Delivery Receipts if (!d->receiptId.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("received")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_message_receipts); + xmlWriter->writeDefaultNamespace(ns_message_receipts); xmlWriter->writeAttribute(QStringLiteral("id"), d->receiptId); xmlWriter->writeEndElement(); } if (d->receiptRequested) { xmlWriter->writeStartElement(QStringLiteral("request")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_message_receipts); + xmlWriter->writeDefaultNamespace(ns_message_receipts); xmlWriter->writeEndElement(); } // XEP-0224: Attention if (d->attentionRequested) { xmlWriter->writeStartElement(QStringLiteral("attention")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_attention); + xmlWriter->writeDefaultNamespace(ns_attention); xmlWriter->writeEndElement(); } // XEP-0249: Direct MUC Invitations if (!d->mucInvitationJid.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_conference); + xmlWriter->writeDefaultNamespace(ns_conference); xmlWriter->writeAttribute(QStringLiteral("jid"), d->mucInvitationJid); if (!d->mucInvitationPassword.isEmpty()) xmlWriter->writeAttribute(QStringLiteral("password"), d->mucInvitationPassword); @@ -918,12 +918,12 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0333: Chat Markers if (d->markable) { xmlWriter->writeStartElement(QStringLiteral("markable")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_chat_markers); + xmlWriter->writeDefaultNamespace(ns_chat_markers); xmlWriter->writeEndElement(); } if (d->marker != NoMarker) { xmlWriter->writeStartElement(MARKER_TYPES.at(d->marker)); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_chat_markers); + xmlWriter->writeDefaultNamespace(ns_chat_markers); xmlWriter->writeAttribute(QStringLiteral("id"), d->markedId); if (!d->markedThread.isNull() && !d->markedThread.isEmpty()) { xmlWriter->writeAttribute(QStringLiteral("thread"), d->markedThread); @@ -938,14 +938,14 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0280: Message Carbons if (d->privatemsg) { xmlWriter->writeStartElement(QStringLiteral("private")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_carbons); + xmlWriter->writeDefaultNamespace(ns_carbons); xmlWriter->writeEndElement(); } // XEP-0066: Out of Band Data if (!d->outOfBandUrl.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_oob); + xmlWriter->writeDefaultNamespace(ns_oob); xmlWriter->writeTextElement(QStringLiteral("url"), d->outOfBandUrl); xmlWriter->writeEndElement(); } @@ -953,7 +953,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0308: Last Message Correction if (!d->replaceId.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("replace")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_message_correct); + xmlWriter->writeDefaultNamespace(ns_message_correct); xmlWriter->writeAttribute(QStringLiteral("id"), d->replaceId); xmlWriter->writeEndElement(); } @@ -962,7 +962,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const for (quint8 i = 0; i < HINT_TYPES.size(); i++) { if (hasHint(Hint(1 << i))) { xmlWriter->writeStartElement(HINT_TYPES.at(i)); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_message_processing_hints); + xmlWriter->writeDefaultNamespace(ns_message_processing_hints); xmlWriter->writeEndElement(); } } @@ -970,7 +970,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0367: Message Attaching if (!d->attachId.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("attach-to")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_message_attaching); + xmlWriter->writeDefaultNamespace(ns_message_attaching); xmlWriter->writeAttribute(QStringLiteral("id"), d->attachId); xmlWriter->writeEndElement(); } @@ -978,7 +978,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0369: Mediated Information eXchange (MIX) if (!d->mixUserJid.isEmpty() || !d->mixUserNick.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("mix")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_mix); + xmlWriter->writeDefaultNamespace(ns_mix); helperToXmlAddTextElement(xmlWriter, QStringLiteral("jid"), d->mixUserJid); helperToXmlAddTextElement(xmlWriter, QStringLiteral("nick"), d->mixUserNick); xmlWriter->writeEndElement(); @@ -987,7 +987,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0380: Explicit Message Encryption if (!d->encryptionMethod.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("encryption")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_eme); + xmlWriter->writeDefaultNamespace(ns_eme); xmlWriter->writeAttribute(QStringLiteral("namespace"), d->encryptionMethod); helperToXmlAddAttribute(xmlWriter, QStringLiteral("name"), d->encryptionName); xmlWriter->writeEndElement(); @@ -996,7 +996,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0382: Spoiler messages if (d->isSpoiler) { xmlWriter->writeStartElement(QStringLiteral("spoiler")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_spoiler); + xmlWriter->writeDefaultNamespace(ns_spoiler); xmlWriter->writeCharacters(d->spoilerHint); xmlWriter->writeEndElement(); } diff --git a/src/base/QXmppMixIq.cpp b/src/base/QXmppMixIq.cpp index 0f0afc29..854b86b8 100644 --- a/src/base/QXmppMixIq.cpp +++ b/src/base/QXmppMixIq.cpp @@ -184,7 +184,7 @@ void QXmppMixIq::toXmlElementFromChild(QXmlStreamWriter* writer) const writer->writeStartElement(MIX_ACTION_TYPES.at(d->actionType)); if (d->actionType == ClientJoin || d->actionType == ClientLeave) { - writer->writeAttribute("xmlns", ns_mix_pam); + writer->writeDefaultNamespace(ns_mix_pam); if (type() == Set) helperToXmlAddAttribute(writer, "channel", d->jid); @@ -194,7 +194,7 @@ void QXmppMixIq::toXmlElementFromChild(QXmlStreamWriter* writer) const writer->writeStartElement("leave"); } - writer->writeAttribute("xmlns", ns_mix); + writer->writeDefaultNamespace(ns_mix); helperToXmlAddAttribute(writer, "channel", d->channelName); if (type() == Result) helperToXmlAddAttribute(writer, "jid", d->jid); diff --git a/src/base/QXmppMucIq.cpp b/src/base/QXmppMucIq.cpp index df17c34c..7120536c 100644 --- a/src/base/QXmppMucIq.cpp +++ b/src/base/QXmppMucIq.cpp @@ -277,7 +277,7 @@ void QXmppMucAdminIq::parseElementFromChild(const QDomElement &element) void QXmppMucAdminIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_muc_admin); + writer->writeDefaultNamespace(ns_muc_admin); for (const QXmppMucItem &item : m_items) item.toXml(writer); writer->writeEndElement(); @@ -316,7 +316,7 @@ void QXmppMucOwnerIq::parseElementFromChild(const QDomElement &element) void QXmppMucOwnerIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_muc_owner); + writer->writeDefaultNamespace(ns_muc_owner); m_form.toXml(writer); writer->writeEndElement(); } diff --git a/src/base/QXmppNonSASLAuth.cpp b/src/base/QXmppNonSASLAuth.cpp index 29337e5e..aa6f8791 100644 --- a/src/base/QXmppNonSASLAuth.cpp +++ b/src/base/QXmppNonSASLAuth.cpp @@ -93,7 +93,7 @@ void QXmppNonSASLAuthIq::parseElementFromChild(const QDomElement &element) void QXmppNonSASLAuthIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_auth); + writer->writeDefaultNamespace(ns_auth); if (!m_username.isEmpty()) writer->writeTextElement("username", m_username); if (!m_digest.isEmpty()) diff --git a/src/base/QXmppPingIq.cpp b/src/base/QXmppPingIq.cpp index c9f88f89..bbec9dca 100644 --- a/src/base/QXmppPingIq.cpp +++ b/src/base/QXmppPingIq.cpp @@ -41,7 +41,7 @@ bool QXmppPingIq::isPingIq(const QDomElement &element) void QXmppPingIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("ping"); - writer->writeAttribute("xmlns", ns_ping); + writer->writeDefaultNamespace(ns_ping); writer->writeEndElement(); } diff --git a/src/base/QXmppPresence.cpp b/src/base/QXmppPresence.cpp index 986f3508..f0353b8d 100644 --- a/src/base/QXmppPresence.cpp +++ b/src/base/QXmppPresence.cpp @@ -490,7 +490,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0045: Multi-User Chat if (d->mucSupported) { xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_muc); + xmlWriter->writeDefaultNamespace(ns_muc); if (!d->mucPassword.isEmpty()) xmlWriter->writeTextElement(QStringLiteral("password"), d->mucPassword); xmlWriter->writeEndElement(); @@ -498,7 +498,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const if (!d->mucItem.isNull() || !d->mucStatusCodes.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_muc_user); + xmlWriter->writeDefaultNamespace(ns_muc_user); if (!d->mucItem.isNull()) d->mucItem.toXml(xmlWriter); for (const auto code : d->mucStatusCodes) { @@ -514,7 +514,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const !d->capabilityVer.isEmpty() && !d->capabilityHash.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("c")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_capabilities); + xmlWriter->writeDefaultNamespace(ns_capabilities); helperToXmlAddAttribute(xmlWriter, QStringLiteral("hash"), d->capabilityHash); helperToXmlAddAttribute(xmlWriter, QStringLiteral("node"), d->capabilityNode); helperToXmlAddAttribute(xmlWriter, QStringLiteral("ver"), d->capabilityVer.toBase64()); @@ -524,7 +524,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0153: vCard-Based Avatars if (d->vCardUpdateType != VCardUpdateNone) { xmlWriter->writeStartElement(QStringLiteral("x")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_vcard_update); + xmlWriter->writeDefaultNamespace(ns_vcard_update); switch(d->vCardUpdateType) { case VCardUpdateNoPhoto: xmlWriter->writeEmptyElement(QStringLiteral("photo")); @@ -541,7 +541,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0319: Last User Interaction in Presence if (!d->lastUserInteraction.isNull() && d->lastUserInteraction.isValid()) { xmlWriter->writeStartElement(QStringLiteral("idle")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_idle); + xmlWriter->writeDefaultNamespace(ns_idle); helperToXmlAddAttribute(xmlWriter, QStringLiteral("since"), QXmppUtils::datetimeToString(d->lastUserInteraction)); xmlWriter->writeEndElement(); } @@ -549,7 +549,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements if (!d->mixUserJid.isEmpty() || !d->mixUserNick.isEmpty()) { xmlWriter->writeStartElement(QStringLiteral("mix")); - xmlWriter->writeAttribute(QStringLiteral("xmlns"), ns_mix_presence); + xmlWriter->writeDefaultNamespace(ns_mix_presence); if (!d->mixUserJid.isEmpty()) helperToXmlAddTextElement(xmlWriter, QStringLiteral("jid"), d->mixUserJid); if (!d->mixUserNick.isEmpty()) diff --git a/src/base/QXmppPubSubIq.cpp b/src/base/QXmppPubSubIq.cpp index 1c984c1b..ea96903b 100644 --- a/src/base/QXmppPubSubIq.cpp +++ b/src/base/QXmppPubSubIq.cpp @@ -198,7 +198,7 @@ void QXmppPubSubIq::parseElementFromChild(const QDomElement &element) void QXmppPubSubIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("pubsub"); - writer->writeAttribute("xmlns", ns_pubsub); + writer->writeDefaultNamespace(ns_pubsub); // write query type writer->writeStartElement(PUBSUB_QUERIES.at(d->queryType)); diff --git a/src/base/QXmppRegisterIq.cpp b/src/base/QXmppRegisterIq.cpp index 77d759c8..79231c9a 100644 --- a/src/base/QXmppRegisterIq.cpp +++ b/src/base/QXmppRegisterIq.cpp @@ -219,7 +219,7 @@ void QXmppRegisterIq::parseElementFromChild(const QDomElement &element) void QXmppRegisterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_register); + writer->writeDefaultNamespace(ns_register); if (!d->instructions.isEmpty()) writer->writeTextElement("instructions", d->instructions); diff --git a/src/base/QXmppResultSet.cpp b/src/base/QXmppResultSet.cpp index a08b0e87..fc4fd88c 100644 --- a/src/base/QXmppResultSet.cpp +++ b/src/base/QXmppResultSet.cpp @@ -134,7 +134,7 @@ void QXmppResultSetQuery::toXml(QXmlStreamWriter* writer) const if (isNull()) return; writer->writeStartElement("set"); - writer->writeAttribute("xmlns", ns_rsm); + writer->writeDefaultNamespace(ns_rsm); if (m_max >= 0) helperToXmlAddTextElement(writer, "max", QString::number(m_max)); if (!m_after.isNull()) @@ -247,7 +247,7 @@ void QXmppResultSetReply::toXml(QXmlStreamWriter* writer) const if (isNull()) return; writer->writeStartElement("set"); - writer->writeAttribute("xmlns", ns_rsm); + writer->writeDefaultNamespace(ns_rsm); if (!m_first.isNull() || m_index >= 0) { writer->writeStartElement("first"); if (m_index >= 0) diff --git a/src/base/QXmppRosterIq.cpp b/src/base/QXmppRosterIq.cpp index 565b985f..01e0956d 100644 --- a/src/base/QXmppRosterIq.cpp +++ b/src/base/QXmppRosterIq.cpp @@ -107,7 +107,7 @@ void QXmppRosterIq::parseElementFromChild(const QDomElement &element) void QXmppRosterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute( "xmlns", ns_roster); + writer->writeDefaultNamespace(ns_roster); // XEP-0237 roster versioning - If the server does not advertise support for roster versioning, the client MUST NOT include the 'ver' attribute. if(!version().isEmpty()) diff --git a/src/base/QXmppRpcIq.cpp b/src/base/QXmppRpcIq.cpp index ed8a8ea1..b69aef48 100644 --- a/src/base/QXmppRpcIq.cpp +++ b/src/base/QXmppRpcIq.cpp @@ -322,7 +322,7 @@ void QXmppRpcResponseIq::parseElementFromChild(const QDomElement &element) void QXmppRpcResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_rpc); + writer->writeDefaultNamespace(ns_rpc); writer->writeStartElement("methodResponse"); if (m_faultCode) @@ -425,7 +425,7 @@ void QXmppRpcInvokeIq::parseElementFromChild(const QDomElement &element) void QXmppRpcInvokeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_rpc); + writer->writeDefaultNamespace(ns_rpc); writer->writeStartElement("methodCall"); writer->writeTextElement("methodName", m_method); diff --git a/src/base/QXmppSasl.cpp b/src/base/QXmppSasl.cpp index 213fcc0b..3f70b093 100644 --- a/src/base/QXmppSasl.cpp +++ b/src/base/QXmppSasl.cpp @@ -138,7 +138,7 @@ void QXmppSaslAuth::parse(const QDomElement &element) void QXmppSaslAuth::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("auth"); - writer->writeAttribute("xmlns", ns_xmpp_sasl); + writer->writeDefaultNamespace(ns_xmpp_sasl); writer->writeAttribute("mechanism", m_mechanism); if (!m_value.isEmpty()) writer->writeCharacters(m_value.toBase64()); @@ -168,7 +168,7 @@ void QXmppSaslChallenge::parse(const QDomElement &element) void QXmppSaslChallenge::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("challenge"); - writer->writeAttribute("xmlns", ns_xmpp_sasl); + writer->writeDefaultNamespace(ns_xmpp_sasl); if (!m_value.isEmpty()) writer->writeCharacters(m_value.toBase64()); writer->writeEndElement(); @@ -197,7 +197,7 @@ void QXmppSaslFailure::parse(const QDomElement &element) void QXmppSaslFailure::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("failure"); - writer->writeAttribute("xmlns", ns_xmpp_sasl); + writer->writeDefaultNamespace(ns_xmpp_sasl); if (!m_condition.isEmpty()) writer->writeEmptyElement(m_condition); writer->writeEndElement(); @@ -226,7 +226,7 @@ void QXmppSaslResponse::parse(const QDomElement &element) void QXmppSaslResponse::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("response"); - writer->writeAttribute("xmlns", ns_xmpp_sasl); + writer->writeDefaultNamespace(ns_xmpp_sasl); if (!m_value.isEmpty()) writer->writeCharacters(m_value.toBase64()); writer->writeEndElement(); @@ -244,7 +244,7 @@ void QXmppSaslSuccess::parse(const QDomElement &element) void QXmppSaslSuccess::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("success"); - writer->writeAttribute("xmlns", ns_xmpp_sasl); + writer->writeDefaultNamespace(ns_xmpp_sasl); writer->writeEndElement(); } diff --git a/src/base/QXmppSessionIq.cpp b/src/base/QXmppSessionIq.cpp index 3221ca85..4916fef5 100644 --- a/src/base/QXmppSessionIq.cpp +++ b/src/base/QXmppSessionIq.cpp @@ -39,7 +39,7 @@ bool QXmppSessionIq::isSessionIq(const QDomElement &element) void QXmppSessionIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("session");; - writer->writeAttribute("xmlns", ns_session); + writer->writeDefaultNamespace(ns_session); writer->writeEndElement(); } /// \endcond diff --git a/src/base/QXmppStanza.cpp b/src/base/QXmppStanza.cpp index f875f17b..002ef65a 100644 --- a/src/base/QXmppStanza.cpp +++ b/src/base/QXmppStanza.cpp @@ -403,13 +403,13 @@ void QXmppStanza::Error::toXml(QXmlStreamWriter *writer) const if (!cond.isEmpty()) { writer->writeStartElement(cond); - writer->writeAttribute("xmlns", ns_stanza); + writer->writeDefaultNamespace(ns_stanza); writer->writeEndElement(); } if (!d->text.isEmpty()) { writer->writeStartElement("text"); writer->writeAttribute("xml:lang", "en"); - writer->writeAttribute("xmlns", ns_stanza); + writer->writeDefaultNamespace(ns_stanza); writer->writeCharacters(d->text); writer->writeEndElement(); } @@ -417,13 +417,13 @@ void QXmppStanza::Error::toXml(QXmlStreamWriter *writer) const // XEP-0363: HTTP File Upload if (d->fileTooLarge) { writer->writeStartElement("file-too-large"); - writer->writeAttribute("xmlns", ns_http_upload); + writer->writeDefaultNamespace(ns_http_upload); helperToXmlAddTextElement(writer, "max-file-size", QString::number(d->maxFileSize)); writer->writeEndElement(); } else if (!d->retryDate.isNull() && d->retryDate.isValid()) { writer->writeStartElement("retry"); - writer->writeAttribute("xmlns", ns_http_upload); + writer->writeDefaultNamespace(ns_http_upload); writer->writeAttribute("stamp", QXmppUtils::datetimeToString(d->retryDate)); writer->writeEndElement(); @@ -636,7 +636,7 @@ void QXmppStanza::extensionsToXml(QXmlStreamWriter *xmlWriter) const // XEP-0033: Extended Stanza Addressing if (!d->extendedAddresses.isEmpty()) { xmlWriter->writeStartElement("addresses"); - xmlWriter->writeAttribute("xmlns", ns_extended_addressing); + xmlWriter->writeDefaultNamespace(ns_extended_addressing); for (const auto &address : d->extendedAddresses) address.toXml(xmlWriter); xmlWriter->writeEndElement(); diff --git a/src/base/QXmppStartTlsPacket.cpp b/src/base/QXmppStartTlsPacket.cpp index f3c7edca..ea5feef9 100644 --- a/src/base/QXmppStartTlsPacket.cpp +++ b/src/base/QXmppStartTlsPacket.cpp @@ -71,7 +71,7 @@ void QXmppStartTlsPacket::parse(const QDomElement &element) void QXmppStartTlsPacket::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement(STARTTLS_TYPES.at(int(m_type))); - writer->writeAttribute(QStringLiteral("xmlns"), ns_tls); + writer->writeDefaultNamespace(ns_tls); writer->writeEndElement(); } /// \endcond diff --git a/src/base/QXmppStreamFeatures.cpp b/src/base/QXmppStreamFeatures.cpp index 84cdc965..992cf309 100644 --- a/src/base/QXmppStreamFeatures.cpp +++ b/src/base/QXmppStreamFeatures.cpp @@ -189,7 +189,7 @@ static void writeFeature(QXmlStreamWriter *writer, const char *tagName, const ch if (mode != QXmppStreamFeatures::Disabled) { writer->writeStartElement(tagName); - writer->writeAttribute("xmlns", tagNs); + writer->writeDefaultNamespace(tagNs); if (mode == QXmppStreamFeatures::Required) writer->writeEmptyElement("required"); writer->writeEndElement(); @@ -210,7 +210,7 @@ void QXmppStreamFeatures::toXml(QXmlStreamWriter *writer) const if (!m_compressionMethods.isEmpty()) { writer->writeStartElement("compression"); - writer->writeAttribute("xmlns", ns_compressFeature); + writer->writeDefaultNamespace(ns_compressFeature); for (const auto &method : m_compressionMethods) writer->writeTextElement("method", method); writer->writeEndElement(); @@ -218,7 +218,7 @@ void QXmppStreamFeatures::toXml(QXmlStreamWriter *writer) const if (!m_authMechanisms.isEmpty()) { writer->writeStartElement("mechanisms"); - writer->writeAttribute("xmlns", ns_sasl); + writer->writeDefaultNamespace(ns_sasl); for (const auto &mechanism : m_authMechanisms) writer->writeTextElement("mechanism", mechanism); writer->writeEndElement(); diff --git a/src/base/QXmppStreamInitiationIq.cpp b/src/base/QXmppStreamInitiationIq.cpp index 5078f411..87067b65 100644 --- a/src/base/QXmppStreamInitiationIq.cpp +++ b/src/base/QXmppStreamInitiationIq.cpp @@ -109,7 +109,7 @@ void QXmppStreamInitiationIq::parseElementFromChild(const QDomElement &element) void QXmppStreamInitiationIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("si"); - writer->writeAttribute("xmlns", ns_stream_initiation); + writer->writeDefaultNamespace(ns_stream_initiation); helperToXmlAddAttribute(writer, "id", m_siId); helperToXmlAddAttribute(writer, "mime-type", m_mimeType); if (m_profile == FileTransfer) @@ -118,7 +118,7 @@ void QXmppStreamInitiationIq::toXmlElementFromChild(QXmlStreamWriter *writer) co m_fileInfo.toXml(writer); if (!m_featureForm.isNull()) { writer->writeStartElement("feature"); - writer->writeAttribute("xmlns", ns_feature_negotiation); + writer->writeDefaultNamespace(ns_feature_negotiation); m_featureForm.toXml(writer); writer->writeEndElement(); } diff --git a/src/base/QXmppStreamManagement.cpp b/src/base/QXmppStreamManagement.cpp index 841184de..1e9a96fc 100644 --- a/src/base/QXmppStreamManagement.cpp +++ b/src/base/QXmppStreamManagement.cpp @@ -67,7 +67,7 @@ void QXmppStreamManagementEnable::parse(const QDomElement &element) void QXmppStreamManagementEnable::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("enable"); - writer->writeAttribute("xmlns", ns_stream_management); + writer->writeDefaultNamespace(ns_stream_management); if (m_resume) writer->writeAttribute("resume", "true"); if (m_max > 0) @@ -137,7 +137,7 @@ void QXmppStreamManagementEnabled::parse(const QDomElement &element) void QXmppStreamManagementEnabled::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("enable"); - writer->writeAttribute("xmlns", ns_stream_management); + writer->writeDefaultNamespace(ns_stream_management); if (m_resume) writer->writeAttribute("resume", "true"); if (m_max > 0) @@ -271,7 +271,7 @@ void QXmppStreamManagementFailed::toXml(QXmlStreamWriter *writer) const QString errorString = strFromCondition(m_error); writer->writeStartElement("failed"); - writer->writeAttribute("xmlns", ns_stream_management); + writer->writeDefaultNamespace(ns_stream_management); writer->writeStartElement(errorString, ns_stanza); writer->writeEndElement(); writer->writeEndElement(); @@ -300,7 +300,7 @@ void QXmppStreamManagementAck::parse(const QDomElement &element) void QXmppStreamManagementAck::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("a"); - writer->writeAttribute("xmlns", ns_stream_management); + writer->writeDefaultNamespace(ns_stream_management); writer->writeAttribute("h", QString::number(m_seqNo)); writer->writeEndElement(); } @@ -320,6 +320,6 @@ bool QXmppStreamManagementReq::isStreamManagementReq(const QDomElement &element) void QXmppStreamManagementReq::toXml(QXmlStreamWriter *writer) { writer->writeStartElement("r"); - writer->writeAttribute("xmlns", ns_stream_management); + writer->writeDefaultNamespace(ns_stream_management); writer->writeEndElement(); } diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp index d885ab04..839229bc 100644 --- a/src/base/QXmppVCardIq.cpp +++ b/src/base/QXmppVCardIq.cpp @@ -1008,7 +1008,7 @@ void QXmppVCardIq::parseElementFromChild(const QDomElement& nodeRecv) void QXmppVCardIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("vCard"); - writer->writeAttribute("xmlns", ns_vcard); + writer->writeDefaultNamespace(ns_vcard); for (const QXmppVCardAddress &address : d->addresses) address.toXml(writer); if (d->birthday.isValid()) diff --git a/src/base/QXmppVersionIq.cpp b/src/base/QXmppVersionIq.cpp index 4b7cded9..7d41aebd 100644 --- a/src/base/QXmppVersionIq.cpp +++ b/src/base/QXmppVersionIq.cpp @@ -96,7 +96,7 @@ void QXmppVersionIq::parseElementFromChild(const QDomElement &element) void QXmppVersionIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_version); + writer->writeDefaultNamespace(ns_version); if (!m_name.isEmpty()) helperToXmlAddTextElement(writer, "name", m_name); diff --git a/src/client/QXmppBookmarkManager.cpp b/src/client/QXmppBookmarkManager.cpp index 0cf993c3..246d2437 100644 --- a/src/client/QXmppBookmarkManager.cpp +++ b/src/client/QXmppBookmarkManager.cpp @@ -77,7 +77,7 @@ void QXmppPrivateStorageIq::parseElementFromChild(const QDomElement &element) void QXmppPrivateStorageIq::toXmlElementFromChild(QXmlStreamWriter *writer) const { writer->writeStartElement("query"); - writer->writeAttribute("xmlns", ns_private); + writer->writeDefaultNamespace(ns_private); m_bookmarks.toXml(writer); writer->writeEndElement(); } diff --git a/src/client/QXmppTransferManager.cpp b/src/client/QXmppTransferManager.cpp index cdcd8689..3621ba6f 100644 --- a/src/client/QXmppTransferManager.cpp +++ b/src/client/QXmppTransferManager.cpp @@ -171,7 +171,7 @@ void QXmppTransferFileInfo::parse(const QDomElement &element) void QXmppTransferFileInfo::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("file"); - writer->writeAttribute("xmlns", ns_stream_initiation_file_transfer); + writer->writeDefaultNamespace(ns_stream_initiation_file_transfer); if (d->date.isValid()) writer->writeAttribute("date", QXmppUtils::datetimeToString(d->date)); if (!d->hash.isEmpty()) diff --git a/src/server/QXmppServer.cpp b/src/server/QXmppServer.cpp index 2cf25362..49a5d6fe 100644 --- a/src/server/QXmppServer.cpp +++ b/src/server/QXmppServer.cpp @@ -48,7 +48,7 @@ static void helperToXmlAddDomElement(QXmlStreamWriter* stream, const QDomElement /* attributes */ QString xmlns = element.namespaceURI(); if (!xmlns.isEmpty() && !omitNamespaces.contains(xmlns)) - stream->writeAttribute("xmlns", xmlns); + stream->writeDefaultNamespace(xmlns); QDomNamedNodeMap attrs = element.attributes(); for (int i = 0; i < attrs.size(); i++) { |
