Create an anonymous multi user chat room

I am trying to create an anonymous room with the smack libraries and I guess I don’t know the magic settings to make this happen, here is the FormField I am submitting to the MultiUserChat room, can anyone provide insight into why this wouldn’t work?

Form existingForm = chatRoom.getConfigurationForm();
Form submitForm = existingForm.createAnswerForm(); FormField formField = new FormField("muc#roomconfig_canAnyoneDiscoverJID");
formField.addValue("0");
submitForm.addField(formField); chatRoom.sendConfigurationForm(submitForm);

Interestingly when I output all available fields from the existing form “canAnyoneDiscoverJID” is not in the list. The admin console of OpenFire does have check box for this though.

fieldVariable = muc#roomconfig_roomname

fieldVariable = muc#roomconfig_roomdesc

fieldVariable = muc#roomconfig_changesubject

fieldVariable = muc#roomconfig_maxusers

fieldVariable = muc#roomconfig_presencebroadcast

fieldVariable = muc#roomconfig_publicroom

fieldVariable = muc#roomconfig_persistentroom

fieldVariable = muc#roomconfig_moderatedroom

fieldVariable = muc#roomconfig_membersonly

fieldVariable = muc#roomconfig_allowinvites

fieldVariable = muc#roomconfig_passwordprotectedroom

fieldVariable = muc#roomconfig_roomsecret

fieldVariable = muc#roomconfig_whois

fieldVariable = muc#roomconfig_enablelogging

fieldVariable = x-muc#roomconfig_reservednick

fieldVariable = x-muc#roomconfig_canchangenick

fieldVariable = x-muc#roomconfig_registration

fieldVariable = muc#roomconfig_roomadmins

fieldVariable = muc#roomconfig_roomowners

You may want to read XEP-0045.

I think a room is non-anonymous by default.

muc#roomconfig_canAnyoneDiscoverJID is not defined by XMPP.

Maybe you are looking for

muc#roomconfig_whois

?

This thread mentions canAnyoneDiscoverJID:

Also canAnyoneDiscoverJID is in the openfire source code

/**

  • Returns true if every presence packet will include the JID of every occupant. This
  • configuration can be modified by the owner while editing the room’s configuration.
  • @return true if every presence packet will include the JID of every occupant.

*/

public boolean canAnyoneDiscoverJID();

/**

  • Sets if every presence packet will include the JID of every occupant. This
  • configuration can be modified by the owner while editing the room’s configuration.
  • @param canAnyoneDiscoverJID boolean that specifies if every presence packet will include the
  •    JID of every occupant.
    

*/

public void setCanAnyoneDiscoverJID(boolean canAnyoneDiscoverJID);

As well as in the db creation script found in the source code:

INSERT INTO mucServiceProp(serviceID,name,propValue) SELECT 1,‘room.canAnyoneDiscoverJID’,propValue FROM jiveProperty WHERE name = ‘muc.room.canAnyoneDiscoverJID’;

DELETE FROM jiveProperty WHERE name = ‘muc.room.canAnyoneDiscoverJID’;

Only because there’s a property and a method somewhere in Openfire doesn’t mean the exact same syntax can be found in the XMPP specification and can therefore be used for the muc#roomconfig_ fields.

I suggest you inspect the possible values for muc#roomconfig_whois. Maybe it has “none” value?

The spec says:

Note: The _whois configuration option specifies whether the room is non-anonymous (a value of “anyone”), semi-anonymous (a value of “moderators”), or fully anonmyous (a value of “none”, not shown here).