1

I'm creating a new multiUserChat room successfully and adding users to this room but when the users go offline they leave the room how can I keep the user in the room permanently I searched the Room config in openfire and no such option please help and if not possible what is the best way to make a permanent groupchat (e.g. whatapp grroup)??? here is the code I'm using

 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);
Diaa Saada
  • 1,026
  • 1
  • 12
  • 22

1 Answers1

3

The XMPP MUC protocol does not support such a thing. Once the full JID that joined the room, (or the bare JID, in case the MUC component supports joining a MUC from multiple resources of a JID) goes offline, the JID will also leave the MUC.

Flow
  • 23,572
  • 15
  • 99
  • 156
  • so what is the best route then to do groupChat where users belongs to groups will stay in like WhatsApp group chat ????????? please someone help – Diaa Saada Oct 30 '13 at 09:25
  • 1
    First thought: Implement the Group Chat with XMPP PubSub – Flow Oct 30 '13 at 09:57
  • so there is no way with openfire and asmack to implement my req ?? I tried "SharedGroups" but openfire client can not manage "sharedGroups" . any idea ?? – Diaa Saada Oct 30 '13 at 11:32
  • Openfire and (a)Smack support PubSub – Flow Oct 30 '13 at 11:39