MUC Room Chat History using Strophe.js web client and MongooseIM As XMPP server

833 Views Asked by At

I am currently struggling to get Chat Histroy of a MUCLight Room using Strophe.js. I dont want to use the direct MUC plugin. I have used the below approaches:-

Sending the below IQ, but no return in the callback:-

<iq type='set' id='mamget1' to='[email protected]'>
    <query xmlns='urn:xmpp:mam:1' queryid='f27' />
</iq>

Sending the below presence but Handler not receiving anything:-

<presence from="jid" id="9855" to="roomJID" xmlns="jabber:client">
<x xmlns="http://jabber.org/protocol/muc">
<history maxstanzas="20"/>
</x>
</presence>

Please tell the correct approach, Thanks in advance

1

There are 1 best solutions below

2
On

MUC Light's history works only with MAM. MAM is not enabled by default on the server, though. Could you make sure relevant modules are enabled? I recommend using the newest MongooseIM from [1] as MAM configuration was significantly simplified there. The documentation about MAM config is here [2].

If you use MongooseIM 2.0.0 or older, please choose relevant doc version in bottom left corner on mongooseim.readthedocs.io


[1]. https://github.com/esl/MongooseIM
[2]. http://mongooseim.readthedocs.io/en/latest/modules/mod_mam