Skip to content Skip to sidebar Skip to footer

How To Get Discussionhistory For Multiuserchat Room Using Asmack?

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

Solution 1:

DiscussionHistoryhistory=newDiscussionHistory();
history.setSince(date);

muc.join(nickname, null, history, SmackConfiguration.getReplyTimeout());

// Get historical message;MessageoldMsg= muc.nextMessage(timeout);

You can also use

history.setMaxChars()
history.setMaxStanzas()
history.setSeconds()

Some examples are in the test code. Check the test testDiscussionHistory.

http://fisheye.igniterealtime.org/browse/smack/trunk/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java?hb=true

Post a Comment for "How To Get Discussionhistory For Multiuserchat Room Using Asmack?"