【问题标题】:Getting "recipient-unavailable(404)" while joining the Group after getting the invitation for Multiuser Chat收到多用户聊天邀请后加入群组时出现“recipient-unavailable(404)”
【发布时间】: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


    【解决方案1】:

    我得到了我的问题的解决方案,我在创建和加入它之前配置了房间,如下所示

    setConfig(muc, groupName);
    muc.create(groupName);
    muc.join("ABC");
    groups.add(groupName);
    

    我只是改变了以下步骤

    muc.create(groupName);
    muc.join("ABC");
    groups.add(groupName);
    setConfig(muc, groupName);
    

    我接受我的回答。

    【讨论】:

      猜你喜欢
      • 2018-11-15
      • 2012-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-16
      • 2013-01-17
      • 1970-01-01
      相关资源
      最近更新 更多