Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 573
RajaReddy PolamReddy Avatar asked Apr 05 '13 10:04

RajaReddy PolamReddy


Video Answer


1 Answers

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.

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

like image 105
Robin Avatar answered Sep 22 '22 18:09

Robin