I am trying to implement a code that enables users to create multi user chat rooms on my Android application.
I am using following code to create a new MUC room.
MultiUserChat mucx = new MultiUserChat(connection, roomName + “@” + serviceName);
try {
mucx.create(nickName);
} catch (XMPPException e) {
Log.e(TAG, "Error on MultiUserChat.create ", e);
return false;
}
Form f = new Form(Form.TYPE_SUBMIT);
try {
mucx.sendConfigurationForm(f);
} catch (XMPPException xe) {
Log.e(TAG, “Error on sendConfigurationForm”, xe);
}
When the MultiUserChat.create() method is called, a presence info is sent to the new room and a presence packet is received from the server as follows.
D/SMACK(17765): 05:03:40 PM SENT (1096879600):
D/SMACK(17765): 05:03:40 PM RCV (1096879600):
After that, Smack sends a presence of type unavaiable and throws an exception with message “Creation failed - Missing acknowledge of room creation”
D/SMACK(17765): 05:03:40 PM SENT (1096879600):
E/XMPPManager(17765): Error on MultiUserChat.create
E/XMPPManager(17765): Creation failed - Missing acknowledge of room creation.:
E/XMPPManager(17765): at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:379)
Looking at the source code, it seems that this error is given when the room already exists. But I am sure that the room does not exists, since I check the room list each time. I also tried the same code with other public xmpp servers but no change. So what can be the reason for this error?
Thanks