Form configForm = multiUserChat.getConfigurationForm(); this.answerForm = configForm.createAnswerForm();
MultiUserChat muc = new MultiUserChat(connection, "roomname@<server>"); muc.create("nickname1"); Form form = muc.getConfigurationForm(); Form submitForm = form.createAnswerForm(); for (Iterator fields = form.getFields();fields.hasNext();){ FormField field = (FormField) fields.next(); if(!FormField.TYPE_HIDDEN.equals(field.getType()) && field.getVariable()!= null){ submitForm.setDefaultAnswer(field.getVariable()); } } submitForm.setAnswer("muc#roomconfig_publicroom", true); muc.sendConfigurationForm(submitForm); muc.join("nickname1"); }catch (Exception e) { e.printStackTrace(); }
MultiUserChat chatRoom = new MultiUserChat(connection, "room786@conference.dishaserver"); chatRoom.create("nagarjuna"); Form form = chatRoom.getConfigurationForm().createAnswerForm(); form.setAnswer("muc#roomconfig_publicroom", true); form.setAnswer("muc#roomconfig_roomname", "room786"); form.setAnswer("muc#roomconfig_roomowners",owners); form.setAnswer("muc#roomconfig_persistentroom", true); chatRoom.sendConfigurationForm(form);
MultiUserChat muc = new MultiUserChat(connection, "myFirstName@"+"you host/domain"); // Create the room muc.create("testbot"); // 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 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 owners = new ArrayList(); owners.add("yourusername@"+"Your Host/Domain"); submitForm.setAnswer("muc#roomconfig_roomowners", owners); // Send the completed form (with default values) to the server to configure the room muc.sendConfigurationForm(submitForm);
form = chat.getConfigurationForm();
@Override public void actionPerformed( ActionEvent event ) { try { final ChatFrame chatFrame = SparkManager.getChatManager().getChatContainer().getChatFrame(); final Form form = chat.getConfigurationForm().createAnswerForm(); new DataFormDialog( chatFrame, chat, form ); } catch ( XMPPException | SmackException | InterruptedException xmpe ) { getTranscriptWindow().insertNotificationMessage( xmpe.getMessage(), ChatManager.ERROR_COLOR ); scrollToBottom(); } } } );
if (isCreated) { Form form = muc.getConfigurationForm();
private void setConfig(MultiUserChat multiUserChat) { 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()); } } submitForm.setAnswer("muc#roomconfig_publicroom", true); submitForm.setAnswer("muc#roomconfig_persistentroom", true); multiUserChat.sendConfigurationForm(submitForm); } catch (Exception e) { e.printStackTrace(); } }
private void setConfig(MultiUserChat multiUserChat) { 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()); } } submitForm.setAnswer("muc#roomconfig_publicroom", true); submitForm.setAnswer("muc#roomconfig_persistentroom", true); multiUserChat.sendConfigurationForm(submitForm); } catch (Exception e) { e.printStackTrace(); } }
MultiUserChat muc = new MultiUserChat(conn, groupId + "@" + ConnectionService.CONFERENCE_IP_ADDRESS); muc.create(nickname); Form form = muc.getConfigurationForm(); Form submitForm = form.createAnswerForm(); for (Iterator<FormField> fields = form.getFields(); fields.hasNext();) {
Form form = groupChat.getConfigurationForm().createAnswerForm(); if (mucRoomDialog.isPasswordProtected()) { String password = mucRoomDialog.getPassword();
Form config = muc.getConfigurationForm();
Form submitForm = multiUserChat.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", roomName);