From 98f2fd04b0a95840584320858ff54cd5caff8f70 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 16 Jun 2019 08:31:15 +0200 Subject: Refactor & clean up QXmppMessage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This simplifies parsing and fixes a possible bug: The bug case looks like this: - We have one element we want to parse (e,g, "attachment" with namespace xyz) - There is another element called "attachment" in the stanza and it's located before the other element. - QXmppMessage tries to parse the attachment element using firstChildElement("attachment") and checks the namespace - The namespace (of the first) element doesn't match - The actual "attachment" element is not parsed This also fixes the "constructor does not initialize these fields: […]" warnings for QXmppMessagePrivate. --- src/base/QXmppConstants.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/base/QXmppConstants.cpp') diff --git a/src/base/QXmppConstants.cpp b/src/base/QXmppConstants.cpp index 92ff8689..a7073c4a 100644 --- a/src/base/QXmppConstants.cpp +++ b/src/base/QXmppConstants.cpp @@ -62,6 +62,7 @@ const char* ns_bytestreams = "http://jabber.org/protocol/bytestreams"; // XEP-0066: Out of Band Data const char* ns_oob = "jabber:x:oob"; // XEP-0071: XHTML-IM +const char *ns_xhtml = "http://www.w3.org/1999/xhtml"; const char *ns_xhtml_im = "http://jabber.org/protocol/xhtml-im"; // XEP-0077: In-Band Registration const char* ns_register = "jabber:iq:register"; -- cgit v1.2.3