So far the only way to grant or revoke moderator and/or administrator privileges is to do it individually. This means that you will have to send a message for each user that you want to change his privileges. In a few days I’'ll add the ability to edit the list of users that have a given privilege (e.g. admin).
Having said that, you can use #grantModerator(String nickname) and #revokeModerator(String nickname) to manage moderator privileges. And to manage administrator privileges you can use #grantAdmin(String jid) and #revokeAdmin(String jid) where jid is a bare jid (e.g. "email@example.com").
// User1 creates the room
muc = new MultiUserChat(conn1, room);
muc.create("testbot"); // User1 sends an empty room configuration form which indicates that we want
// an instant room
muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT)); // The room owner converts the instant room into a moderated room
Form form = muc.getConfigurationForm();
Form answerForm = form.createAnswerForm();
muc.sendConfigurationForm(answerForm); // User2 joins the new room (as a visitor)
MultiUserChat muc2 = new MultiUserChat(conn2, room);
muc2.join("testbot2",SmackConfiguration.getPacketReplyTimeout(),null,0,-1,-1,null); // The room''s owner grants moderator privileges to a visitor
muc.grantModerator("testbot2"); // The room''s owner grants admin privileges to a user
Message was edited by: dombiak_gaston