如何获得openfire聊天室消息的历史记录

时间:2015-08-03 11:27:17

标签: xmpp openfire messages strophe multiuserchat

我使用Strophe库连接到OpenFire XMPP服务器。

如何收到聊天室消息的历史记录?

var o = {to:'roomName@conference.domain.com/youNick'}; 
var m = $pres(o); 
m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null); 
connection.send(m.tree());

我加入房间时只收到25封邮件。如何获取聊天室的25条消息?

1 个答案:

答案 0 :(得分:2)

您应该添加<history/>元素:https://xmpp.org/extensions/xep-0045.html#enter-managehistory

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