Sreenivas K
Sreenivas K

Reputation: 119

How to get openfire chat room messages history

I use Strophe library to connect to an OpenFire XMPP server.

How can I receive the chat room messages history ?

var o = {to:'[email protected]/youNick'}; 
var m = $pres(o); 
m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null); 
connection.send(m.tree());

I get only 25 messages when I join room. How to get past 25 message of the chat room ?

Upvotes: 1

Views: 1145

Answers (1)

xnyhps
xnyhps

Reputation: 3316

You should add a <history/> element: https://xmpp.org/extensions/xep-0045.html#enter-managehistory.

<x xmlns='http://jabber.org/protocol/muc'>
    <history maxstanzas='100'/>
</x>

Upvotes: 2

Related Questions