【发布时间】:2015-10-25 13:12:51
【问题描述】:
我正在使用带有 Strophe.js 的 ejabberd 15.06 版本。从我的后端数据库中检索一对一聊天工作正常。但是如何从数据库中检索群聊历史记录?
例如,如果我有一个“strophe”组。当新用户加入strophe组时,应该显示其他用户在组中的聊天记录。
我正在使用此代码
var pres = $pres({ to: room + "/" + nickname, from: connection.jid });
connection.send( msg.c('x', {xmlns: NS_MUC}));
if(chat_history != null){
var msg_history = msg.c('x', { "xmlns": "http://jabber.org/protocol/muc"}).c("history", chat_history, {maxstanzas: 50});
debugger;
console.log(msg_history);
}
在我的控制台中看起来像
h.Builder {nodeTree: presence, node: x}
我不知道如何获取群聊的历史记录。请帮忙
【问题讨论】:
标签: javascript ejabberd strophe multiuserchat