问题描述
如何从 MultiUserChat
A MUC房的的的 DiscussionHistory?我能够通过使用aSmack库创建MultiUserChat实例和房间,现在我想告诉所有发生在房间里的previous谈话。
任何人在同一个经验丰富的,请帮助我。我谷歌搜索了很多关于这一点,但我还是我以前不得到任何适当的文件/解释这一点。
DiscussionHistory历史=新DiscussionHistory();
history.setSince(日期);
muc.join(昵称,空,历史,SmackConfiguration.getReplyTimeout());
//获取历史信息;
消息oldMsg = muc.nextMessage(超时);
您也可以使用
history.setMaxChars()
history.setMaxStanzas()
history.setSeconds()
一些例子是在测试code。检查测试的 testDiscussionHistory 的。
<一个href="http://fisheye.igniterealtime.org/browse/smack/trunk/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java?hb=true">http://fisheye.igniterealtime.org/browse/smack/trunk/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java?hb=true
How to get the DiscussionHistory of a MUC room from MultiUserChat
? I am able to create MultiUserChat instance and room by using aSmack library, now I want to show all the previous conversations that happened in the room.
Anybody experienced in the same please help me. I Google searched a lot about this but still I did't get any proper documentation / explanation on this.
DiscussionHistory history = new DiscussionHistory();
history.setSince(date);
muc.join(nickname, null, history, SmackConfiguration.getReplyTimeout());
// Get historical message;
Message oldMsg = muc.nextMessage(timeout);
You can also use
history.setMaxChars()
history.setMaxStanzas()
history.setSeconds()
Some examples are in the test code. Check the test testDiscussionHistory.
这篇关于如何使用aSmack获得DiscussionHistory为MultiUserChat房间吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!