Saamzzz
Saamzzz

Reputation: 256

I want to disable retrieving Group chat (MUC) history while joining a group - Android

I am always receiving group chat history while joining the room. To be more specific, whenever I join a group, I am receiving the last one message(only one message) which I have sent to that group. I have tried the following methods to disable this..

Eventhough I have tried all these possible ways, am still receiving a history message while joining the room. please note that the message which I am receiving at the time of joining, contains delay extension. if it matters.

Upvotes: 2

Views: 2294

Answers (1)

Lokesh
Lokesh

Reputation: 3334

Try this..

    MultiUserChat muc = new MultiUserChat(mConnection, room_name);
    Log.d(TAG, "JOINING => " + room_name);

    DiscussionHistory history = new DiscussionHistory();
    history.setMaxStanzas(0);

     muc.join(mNickName, null, history,SmackConfiguration.getDefaultPacketReplyTimeout());

And if get "group is asynchronous" this msg, then its just like notification that you join group. just put if condition for this in groupchat listener.

Upvotes: 8

Related Questions