MamManager incorrectly claims MAM not supported

Hello.

I am trying to write an XMPP client using Smack, and am hosting my own XMPP server (Prosody), which has MAM enabled. Using other clients MAM works fine, and message histories are restored. However, when trying to implement this code myself, I have run into the issue that MamManager.isSupported() returns false.

I have searched for this issue but haven’t found much about it :frowning: I have probably made some stupid mistake. I am confident the issue is client-side as MAM works with other clients.

Here is the code, which I call after having authenticated with the server:

MamManager manager = MamManager.getInstanceFor(connectionToServer);
manager.isSupported(); //false :(

If I try to use the MamManager anyway, I get XMPPError: service-unavailable - cancel.

Smack version: 4.3.4

Sorry for my poor understanding, I am fairly new to networking in general.
Any help or advice would be much appreciated.
Many thanks, John

Could you check, which features your server announces?
A stanza trace would be helpful to debug the issue.

That is probably caused by different MAM versions between client (Smack) and server.

That was my first guess as well, but the prosody mod_mam supports all MAM versions, so I ruled that one out (given that OP is running this mod_mam).

Hello, thank you for your replies, and sorry for this late response. I have attempted to get a stanza trace. Here is an excerpt; I seem to be declaring a mam feature, though possibly it is the wrong version. I’ve cut things that I think are irrelevant, hope I haven’t missed anything important.
It’s feasible that I’ve done something stupid in setting up the server, which would explain why seemingly nobody else has had this issue.

...
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='account' type='registered'/>
<identity category='pubsub' type='pep'/>

<feature var='urn:ietf:params:xml:ns:vcard-4.0'/>
...
<feature var='http://jabber.org/protocol/pubsub#publish-options'/>
<feature var='urn:xmpp:mam:2'/>
<feature var='urn:xmpp:sid:0'/>
<feature var='urn:xmpp:pep-vcard-conversion:0'/>

</query></iq>

In my debug log this stanza is shown after the log stating that MAM is not supported, but this could just be because I used an Async listener.

Thank you for your time!

P.S. If the versions are incompatible, how might I resolve this? Should I change my server-side version or somehow change the Smack version?

Your server seems to only support MAM version 2 as suggested by this line:

Smack however only supports MAM version 1 (for now).
I’m pretty sure that prosody can be configured to also support MAM:1, so you might want to look into that.
I suggest joining the prosody support chat if you need help configuring your server :slight_smile:

Hey, thanks for the reply again.
The guys on the Prosody support chat say Prosody no longer supports MAM 1 (or 0), so I guess this is now a feature request: are there any plans to introduce MAM 2 support for Smack? If so, when?
Thanks.

Edit: Just in case anyone else ever happens to have the same issue, I have now got it working by installing an old version of the mod_mam module from the community repo :slight_smile: Thank you to Paul and Flow!

Glad to hear that your problem is (sort of) fixed for now :smiley:
I recently had a discussion with @Flow and we came to the conclusion that MAM:2 support probably isn’t too hard to do as there were only very slight changes to the protocol in between versions, so MAM:2 may come pretty soon™.

3 Likes

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.