【发布时间】:2014-10-31 02:08:16
【问题描述】:
我正在使用以下代码在 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 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();
}
}
在此代码之后我的组出现在 XMPP 服务器中,然后我使用以下代码发送邀请
muc.invite("abab@" + "jabber.org", "Lets have ");
然后下一个用户 USER2 也收到邀请,当尝试加入组时使用
MultiUserChat mucJoin = new MultiUserChat(connection, groupName);
mucJoin.join("USER2");
然后我收到错误“recipient-unavailable(404)”。
请让我知道我在哪里做错了,以及为什么我会收到此错误。 谢谢 巴杰瓦
【问题讨论】:
标签: android xmppframework