新しい multiUserChat ルームを正常に作成し、このルームにユーザーを追加していますが、ユーザーがオフラインになると、ユーザーがルームを離れます。ユーザーをルームに永久に保持するにはどうすればよいですか? openfire でルーム構成を検索しましたが、そのようなオプションはありません。助けてください。永続的なグループチャットを作成する最良の方法は何ですか (例: whatapp グループ)? ここに私が使用しているコードがあります
MultiUserChat muc = new MultiUserChat(MyApplication.connection, room);
// Create the room
SmackConfiguration.setPacketReplyTimeout(2000);
muc.create("testGroup2s2");
// Get the the room's configuration form
Form form = muc.getConfigurationForm();
// Create a new form to submit based on the original form
Form submitForm = form.createAnswerForm();
// Add default answers to the form to submit
for (Iterator<FormField> fields = form.getFields(); fields.hasNext();) {
FormField field = (FormField) fields.next();
if (!FormField.TYPE_HIDDEN.equals(field.getType()) && field.getVariable() != null) {
// Sets the default value as the answer
submitForm.setDefaultAnswer(field.getVariable());
}
}
// Sets the new owner of the room
List<String> owners = new ArrayList<String>();
owners.add(MyApplication.connection.getUser() );
submitForm.setAnswer("muc#roomconfig_roomowners", owners);
muc.sendConfigurationForm(submitForm);