Android 获得;收件人不可用(404)“;在收到多用户聊天邀请后加入群时
我使用以下代码在android中创建组Android 获得;收件人不可用(404)“;在收到多用户聊天邀请后加入群时,android,xmppframework,Android,Xmppframework,我使用以下代码在android中创建组 MultiUserChat muc = new MultiUserChat(connection, groupName + "@conference.jabber.org"); setConfig(muc, groupName); muc.create(groupName); muc.join("ABC"); groups.add(groupName); private void setConfig(MultiUserChat multiUserCh
MultiUserChat muc = new MultiUserChat(connection, groupName + "@conference.jabber.org");
setConfig(muc, groupName);
muc.create(groupName);
muc.join("ABC");
groups.add(groupName);
private void setConfig(MultiUserChat multiUserChat, String groupName) {
try {
Form form = multiUserChat.getConfigurationForm();
Form submitForm = form.createAnswerForm();
for (Iterator<FormField> fields = submitForm.getFields(); fields
.hasNext();) {
FormField field = (FormField) fields.next();
if (!FormField.TYPE_HIDDEN.equals(field.getType())
&& field.getVariable() != null) {
submitForm.setDefaultAnswer(field.getVariable());
}
}
List<String> owners = new ArrayList<String>();
owners.add("abc" + "@" + "@conference.jaber.org");
submitForm.setAnswer("muc#roomconfig_roomowners", owners);
submitForm.setAnswer("muc#roomconfig_roomname", groupName);
submitForm.setAnswer("muc#roomconfig_publicroom", true);
submitForm.setAnswer("muc#roomconfig_persistentroom", true);
multiUserChat.sendConfigurationForm(submitForm);
} catch (Exception e) {
e.printStackTrace();
}
}
然后,下一个用户USER2在尝试使用加入组时也会收到邀请
MultiUserChat mucJoin = new MultiUserChat(connection, groupName);
mucJoin.join("USER2");
然后我得到了错误“收件人不可用(404)”
请让我知道我哪里做错了,为什么我会犯这个错误。
谢谢
Bajwa我得到了问题的解决方案,在创建和加入房间之前,我正在配置房间,如下所示
setConfig(muc, groupName);
muc.create(groupName);
muc.join("ABC");
groups.add(groupName);
我只是改变了以下步骤
muc.create(groupName);
muc.join("ABC");
groups.add(groupName);
setConfig(muc, groupName);
我接受我的回答
muc.create(groupName);
muc.join("ABC");
groups.add(groupName);
setConfig(muc, groupName);