Project

General

Profile

MUC returns "Field not found for the specified variable name."

Ralph Hammerfell
Added about 3 years ago

I'm trying to create a room from the client using the following code:

        MultiUserChat chatRoom = new MultiUserChat(connection, roomname + "@muc." + hostName); 
        chatRoom.create(roomnickname);
        Form form = chatRoom.getConfigurationForm().createAnswerForm();
        Iterator<FormField> fields = form.getFields();        
        form.setAnswer("muc#roomconfig_publicroom", false);
        form.setAnswer("muc#roomconfig_roomname", roomname);
        form.setAnswer("muc#roomconfig_roomowners",roomowner + "@" + serviceName);
        form.setAnswer("muc#roomconfig_persistentroom", true);
        chatRoom.sendConfigurationForm(form);

The room is being created, as far as I know, but the (Smack) library is returning the following error:

java.lang.IllegalArgumentException: Field not found for the specified variable name.
    org.jivesoftware.smackx.Form.setAnswer(Form.java:136)

So I printed out all the fields coming from Tigase, and the roomowners aren't being returned.

        muc#roomconfig_roomname
        muc#roomconfig_roomdesc
        muc#roomconfig_persistentroom
        muc#roomconfig_publicroom
        muc#roomconfig_moderatedroom
        muc#roomconfig_membersonly
        muc#roomconfig_passwordprotectedroom
        muc#roomconfig_roomsecret
        muc#roomconfig_anonymity
        muc#roomconfig_changesubject
        muc#roomconfig_enablelogging

Is there a reason why the roomowners variable isn't being returned? Does Tigase automatically put the logged in user as room owner? Or is something else wrong?

I'm using Tigase 5.3.0, on Centos 6.


Replies (3)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Ralph Hammerfell wrote:

Is there a reason why the roomowners variable isn't being returned? Does Tigase automatically put the logged in user as room owner? Or is something else wrong?

It's simply not supported hence it's not present in available room configuration. For the management of users you can utilize membership/affiliation.

Added by Ralph Hammerfell about 3 years ago

That's actually why I need the room owners. But the question is, who has the permission to add/remove members if I'm not setting an owner? Is it the person who created the room?

Added by Wojciech Kapcia TigaseTeam about 3 years ago

The user that created the room is saved as an owner of the room initially.

    (1-3/3)