powered by Jive Software

Should i wait for MUC support?

Hi there,

I started my master thesis with Smack as the main library and enjoyed using it. The thesis is supposed to be the backbone for a Computer Supported Collaborative Work project.

Hence, I desperately need password protected Rooms and a better MUC integration.The Project is way to far along to change to MUSE or whatever.

Is there any timeframe for the MUC extension? Or is a small hint possible? I still have 3 month to do the job. Or has anybody some nice advice, how to create and join password protected rooms.

Thx in advance!

I know that Gato is working on full MUC compliance. I’'ll let him provide a time-frame for when it will be ready, though. Worst case, you should be able to add joining password-protected rooms with a few hours of work. You should be up for it as a masters in CS.


Thx for the quick response!

As a Master Student I better skip my question for the JUD support and do this on my own.Please let me know about the timeframe for the MUC soon. Otherwise I will ask again and again…


Today I checked in an early version of MUC. This version allows you to create rooms, set room’'s configuration, join chat rooms (using password, specifying history), view occupants and send and receive messages. It should be available in the next daily build.

What is missing? The whole administrator functionalities, some owner functionalities, send and receive invitations & rejections, etc… My goal is to finish the whole MUC implementation in a month. Are you interested in some special functionality? I could accommodate my development sequence so I can meet your requirement.


– Gato

Hello Gato,

This reply is more than I am used to and I am quite excited (at the moment). It seems I have to play around with the new MultiUserChat class for a while, but in deed there is a password and much more. Hence, I can go on with my project again.

I have not fixed my requirements for the administration functionalities yet, but will look into soon.


Hi again,

After playing with the MultiUserChat in the Apr.2 build, it seems i can’'t enter password protected rooms. Hence, i compared the messages created by smack with one out of the client exodus.

The main difference seems to be this part:





I think i neeed some help here !

The full version, if someone has time:

with exodus

SENT: cotoVerfügbar0< /presence>

RECV: <presence from=’‘mycotoroom@conference.jabber.org/poen4’’ to=’‘poen@jabber.org/Exodus’’><c node=’‘http://exodus.jabberstudio.org/caps’’ ver=’‘’’ xmlns=’‘http://jabber.org/protocol/caps’’/>Verfügbar0<x xmlns=’‘http://jabber.org/protocol/muc#user’’><item affiliation=’‘owner’’ jid=’‘poen@jabber.org/Exodus’’ role=’‘moderator’’/>

RECV: <message from=’‘mycotoroom@conference.jabber.org’’ to=’‘poen@jabber.org/Exodus’’ type=’‘groupchat’’>mycotoroom


with smack


<presence from=’‘myCoToRoom@conference.jabber.org/poen’’ id=’‘Imwyc-156’’ to=’‘poen@jabber.org/Smack’’ type=’‘error’’><x xmlns=’‘http://jabber.org/protocol/muc’’> password=“coto”<error code=’‘401’’>Password required to join this room.


You are correct. Thanks for the bug report. I just checked in the fix so it should be available in the next daily build.


– Gato


Status update: Tomorrow’'s daily build will include many new functionalities (e.g. ability to: create room, send private messages, change nickname, change availability status, invite and decline invitations, etc.)

– Gato

Hi Gato,

your MUC support is growing fast! I have already build a MUC Create Dialog. It works fine, but how am i supposed to

change the answer values ?

I would like to bind the FormFields with the JComponents when created, and change the Field values when the dialog is closed. But the answer form seems to be new and breaks my binding. Can i change the default values in the original form to become answers ?

Do you have any advice, how the interaction with the GUI is meant to be ?


Hey Joachim,

The idea is to bind the UI to the form that you will send to the server. This means that the UI will access the original form (type=“form”) to learn how to render the form but will bind its fields to the form that you are completing (type="submit).

I just checked in some modifications that will help you implement this idea. The #createAnswerForm will now include all the fields except for the fields of type FIXED. The hidden fields will include the default value while the rest of the included fields will have no answer. It’‘s up to your UI to set the FormField’'s answer using the Form.setAnswer or directly adding values to the field using #addValue or #addValues.

Let me know how it goes.


– Gato

THX for the explanation Gato,

I am as confused as before, but on a much higher level.

When the GUI renders the fields it would be easy to bind GUI elements and form fields. Both are there in place in the same loop. But because of the new submit form the link is for the wrong form.

When i understand you correct, i have to remember (bind) the FormFields variable (type String) for each GUI Element, instead of a reference to the FormField!?. In this way i could use the Form.addAnswer function.

Is this a way to bind the GUI to the submit form ?


p.s. I can not find a Form.setAnswer(…) function.


I can not find a Form.setAnswer(…) function.

First of all, you need to download the new daily build which contains the latest modifications. FYI, the #addAnswer method was replaced by #setAnswer.

When the GUI renders the fields it would be easy to

bind GUI elements and form fields. Both are there in

place in the same loop. But because of the new submit

form the link is for the wrong form.

In the latest daily build you will find that the “new submit form” already contains ALL the FormFields that you need to fill out. This means that you can safely bind the UI to these FormFields.

You will probably want to iterate on the fields of the “original form” (which contains the labels, options, etc.) and:

Option 1: for each field you will have to send the Form.getField(String variable) method to the “new submit form” in order to get the FormField to bind to.

Option 2: for each field you will want to store the variable name and once you have the value to fill out the field you will use Form.setAnswer(String variable, …) to set the answer. Note: This option does not directly bind the UI to the FormField.


– Gato

It is done,

and easy to do with some help ! ( option 2 )

Maybe you know some public MUC Rooms that support fields like :




for testing purposes.

I’'m trying to create a persistent group chat and then

join it (or just join if the room already exists). Using

GroupChat sometimes lets me do this and sometimes gives a ‘‘404 NotFound’’ error. When it does succeed, the room is not


I downloaded the Apr 16 nightly build and see the MUC support in smackx.jar.

THANKS. Hopefully this will avoid the 404 errors. Poking thru. the source I see the MUC classes and I see the MUCInitialPresence and default configuration. And I see

the Form class, but I’'d like a sample code snippet to

send a msg like:

<iq type=’‘set’’ id=’‘someid’’ to=’‘myroom@service’’>

<query xmlns=’‘http://jabber.org/protocol/much#owner’’>

<x xmlns=’‘jabber:x:data’’ type=’‘submit’’>

<field var=’‘form’’>config

<field var=’‘muc#owner_persistentroom’’>1



You can take a look at the MultiUserChatTest class which provides sample code to create an instant room and a reserved room. In this class you could also find how to send a form to the server in order to configure the room.

FYI, using MUC you can get the 404 error if you attempt to enter a room that does not exist and the server restricts the privilege of creating rooms or if you attempt to enter a room while it is locked.

Let me know if you need any help.


– Gato