我通过使用XMPP服务器(韵律)和smack库开发了android聊天应用程序。当我尝试创建聊天室时,成功创建了聊天室,但是当我发送配置表单时,出现此错误:
XMPPError:错误请求-取消
我的代码:
EntityBareJid entityBareJid = null;
entityBareJid = JidCreate.entityBareFrom("room5@conference.MyServiceName.com");
MultiUserChat muc = multiUserChatManager.getMultiUserChat(entityBareJid);
muc.join(Resourcepart.from("rshRoom5"));
Log.d("GROUP" , "Room now is created ...... ");
Form form = muc.getConfigurationForm();
Form answerForm = form.createAnswerForm();
answerForm.setAnswer("muc#roomconfig_persistentroom", true);
muc.sendConfigurationForm(answerForm);
这是服务器配置文件中的muc组件:
组件“ conference.MyServiceName.com”“ muc”
name =“聊天室服务器”
restrict_room_creation = false;