MUC room is locked with default installation of tigase

497 views Asked by At

I have installed tigase7.0.2 with basic configurations.

Now i am performing MUC using installed server with following codes:

For Creating Room

MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
MultiUserChat muc = MainActivity.manager.getMultiUserChat("myroom@muc." + connection.getServiceName());

For joining Room

    muc = MainActivity.manager.getMultiUserChat("myroom@muc." + connection.getServiceName());
    muc.join(connection.getUser().split("@")[0]);
    muc.addMessageListener(new MessageListener() {
   @Override
   public void processMessage(final Message message) {
           runOnUiThread(new Runnable() {
           @Override
           public void run() {
          Toast.makeText(UserListActivity.this, message.getFrom() + ":" + message.getBody(), Toast.LENGTH_SHORT).show();
    }
       });
    }
   });

When i am joining the room following message is appears in Toast.

: Room is locked. Please configure.
: Welcome! You created new Multi User Chat Room. Room is locked now. Configure it please!

When i joining room it gives following error in the log.

1

There are 1 answers

0
legoscia On

When you first create a MUC room, it is "locked" until you configure it. There are two ways to configure the room: either accept the default configuration (this is called an "instant" room), or specify the configuration you want.

Creating an instant room is described in section 10.1.2 of XEP-0045:

<iq from='[email protected]/desktop'
    id='create1'
    to='[email protected]'
    type='set'>
  <query xmlns='http://jabber.org/protocol/muc#owner'>
    <x xmlns='jabber:x:data' type='submit'/>
  </query>
</iq>

That is, send an IQ message with type set, containing a query element in the MUC owner namespace, containing just a form "submit". This is also mentioned in this answer.

To use a specific configuration for the room, see section 10.1.3 of XEP-0045. First request the configuration form to find out which options are supported, and then fill it out with the settings you need. This answer describes how to create a room that is public and persistent.