【发布时间】:2020-04-19 18:03:27
【问题描述】:
我在创建持久性房间和 MUC 时遇到问题,无法发送房间配置表。我发送的未设置为表单字段的值和默认值发送到服务器。
【问题讨论】:
标签: android openfire smack multiuserchat
我在创建持久性房间和 MUC 时遇到问题,无法发送房间配置表。我发送的未设置为表单字段的值和默认值发送到服务器。
【问题讨论】:
标签: android openfire smack multiuserchat
multiUserChatManager = MultiUserChatManager.getInstanceFor(connection);
multiUserChat = multiUserChatManager.getMultiUserChat(JidCreate.entityBareFrom(roomJID));
multiUserChat.create(Resourcepart.from(nickname));
Form form = multiUserChat.getConfigurationForm();
Form submitForm = form.createAnswerForm(); submitForm.getField("muc#roomconfig_publicroom").addValue("1");
submitForm.getField("muc#roomconfig_enablelogging").addValue("1");
submitForm.getField("x-muc#roomconfig_reservednick").addValue("0");
submitForm.getField("x-muc#roomconfig_canchangenick").addValue("0");
submitForm.getField("x-muc#roomconfig_registration").addValue("0");
submitForm.getField("muc#roomconfig_passwordprotectedroom").addValue("0");
submitForm.getField("muc#roomconfig_roomname").addValue(roomName);
submitForm.getField("muc#roomconfig_whois").addValue("participants");
submitForm.getField("muc#roomconfig_membersonly").addValue("1");
submitForm.getField("muc#roomconfig_persistentroom").addValue("1");
multiUserChat.sendConfigurationForm(submitForm);
这是您发送房间配置和配置房间的方式。
【讨论】: