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

2.2k views Asked by At

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

  • As per the documentation suggests, I have passed the value 'maxchars='0'' with the history parameter of initial presence while joining the room.
  • At the web admin page go to Group Chat section, then Group Chat Settings -> Group Chat Service Properties -> History Settings -> Don't show History

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.

1

There are 1 answers

4
Lokesh On

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.