I appreciate it does not, but a lot of MAM is backward compatible and allowing the namespace to be changed via a config is much better than hacking the java script to have chat history with openfire for now.
Some of it is backwards compatible, but not all. So there will be breakage and weird errors. Why don't you make a pull request which adds support for MAM:1? Then we can add such a config value.
There are no weired errors or breakage. It works fine
The namespace bump to mam:2 is due to the introduction of the archive id, which mainly affects servers.
https://xmpp.org/extensions/xep-0313.html#archives_id
However, I'm not sure how queries by id should be done in mam:1, it can't be the same as in mam:2. So I'm not convinced that it's just a matter of adding a config option and calling it a day.
Agreed. However until openfire implements mam:2, I would rather have a config option instead of hacking converse.js
jcbrand changed the title from Put MAM version behind a config value
The title change has changed the original issue and has invalidated this discussion. There is no need to support mam:1 in converse. The original issue reported was for the MAM namespace version to be configurable in order to be backward compatible some XMPP servers like Openfire. Some working features of MAM is better choice than none.
So I'm not convinced that it's just a matter of adding a config option and calling it a day.
I agree it is not the long term solution and implementing mam:2 in openfire is desirable. Until that day comes, we need a neater interim solution as chat history is a deal breaker with enterprise users.
Here is a screenshot of Openfire chat history working with converse after hacking the namespace to mam:1

The title change has changed the original issue and has invalidated this discussion.
Supporting mam:1 might mean simply adding a config option, or it might mean having to do more. So your original request is not invalidated.
A pull request for this is welcome. I have limited time and energy, especially at the moment.
A pull request for this is welcome. I have limited time and energy, especially at the moment.
Thanks. I am happy to raise a PR. Just wanted to make sure we are agreed on the purpose and intent before I start.
I am able to replicate the namespace change from a plugin without hacking converse. This issue is now resolved for me. No need for a PR.
@deleolajide can you please share how you resolved namespace change to support history? I am facing same issue. Thanks
can you please share how you resolved namespace change to support history
// override converse for openfire
Strophe.addNamespace('MAM', 'urn:xmpp:mam:1');
See https://github.com/igniterealtime/Pade/blob/master/extension/inverse/plugins/webmeet.js for more detail
I added the following lines right after calling initialize and it worked.
converse.env.Strophe.addNamespace('MAM', 'urn:xmpp:mam:1');
Thank you for your help @deleolajide
From version 4.1.3 hacking Converse to use MAM:1 instead of MAM:2 will no longer work because Converse will rely on the MAM:2 guarantee that the message archive-id is the same as the stanza-id.
This means that Converse requires archive ids to be globally unique and equivalent to the XEP-0359 stanza-id. This is necessary for message deduplication.
Also, due to this change, MAM:1 support will not be added.