migrated from asmack to smack 4.1 beta2. The muc rooms created are no longer persistent.
MultiUserChatManager mucm=MultiUserChatManager.getInstanceFor(connection);
muc=mucm.getMultiUserChat(groupid+"@conference.localhost");
DiscussionHistory histroy=new DiscussionHistory();
histroy.setMaxStanzas(10);
muc.createOrJoin(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout());
muc.nextMessage();
when created with gajim, the rooms are persistent.
EDIT : Here is code we used earlier. By default the chat rooms were persistent,
muc = new MultiUserChat(connection, groupid+"@conference.localhost");
if(!muc.isJoined())
{
DiscussionHistory histroy=new DiscussionHistory();
histroy.setMaxStanzas(10);
muc.join(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout());
muc.nextMessage(0);
}
You need to set
muc#roomconfig_persistentroom
totrue
in the MUC configuration from when creating the room.Note that not all XMPP MUC services support persistent rooms. For more information see:
You need to submit form like this for making a persistent group:
This is how you can send the room configuration from and configure room. For more Details please see question. How to send room configuration form and create persistce rooms from android using smack 4.3.4
In smack 4.1.1, The answers given by @saurabh dixit throw an exception. Please check this thread on ignite website Correct implementation for persistent rooms smack 4.1.1