Hi everyone,
our company is running Openfire 4.0.1 together with the Monitoring Service plugin 1.5.0.
I am currently writing a webchat using the Strophe.js Javascript library and am having some issues when querying the message archive. Concretely, I am sending the following IQ stanza, in order to retrieve all messages of the current user according to XEP-0313:
<body xmlns="http://jabber.org/protocol/httpbind" rid="8250195" sid="6r6t0mvt47">
<presence xmlns="jabber:client"/>
<iq xmlns="jabber:client" type="set" id="xmpp_1@mydomain/web">
<query xmlns="urn:xmpp:mam:0">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>urn:xmpp:mam:0</value>
</field>
</x>
<set xmlns="http://jabber.org/protocol/rsm"/>
</query>
</iq>
</body>
However, Strophe always throws a “badformat” error when parsing the result body. While analyzing the issue, I noticed that this is most likely due to an invalid XML response that is returned by the Monitoring Service plugin. The result of the above mentioned IQ stanza looks as follows:
<body xmlns="http://jabber.org/protocol/httpbind" ack="8250195">
[previous 7 messages]
<message xmlns="jabber:client" to="xmpp_1@mydomain/web">
<result xmlns="urn:xmpp:mam:0" id="238">
<forwarded xmlns="urn:xmpp:forward:0">
<delay xmlns="urn:xmpp:delay" stamp="2016-02-14T02:09:59.073Z"/>
<message xmlns="" to="xmpp_1@mydomain" type="chat" from="xmpp_526@mydomain/65wiba29w4">
<body>test message</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
</message>
</forwarded>
</result>
</message>
<message>
<fin xmlns="jabber:client" xmlns="urn:xmpp:mam:0" complete="true">
<set xmlns="http://jabber.org/protocol/rsm">
<first index="0">231</first>
<last>238</last>
<count>8</count>
</set>
</fin>
</message>
</body>
Running the response through a XML validator revealed that the <fin> tag contains 2 different namespaces: “jabber:client” as well as “urn:xmpp:mam:0”.
I would appreciate if someone could look into this, as I am currently blocked here.