Get openfire chatroom settings on create

I’m developing a plugin. It has a handler on chatroom creating. When I create a new room with specified maxUsers (doesn’t matter from admin panel or rest api plugin) I always get maxUsers = 30.

Here is my code:

public void roomCreated(room jid) {
   // ...
   MUCRoom mucRoom = XMPPServer.getInstance()
      .getMultiUserChatManager()
      .getMultiUserChatService(room)
      .getChatRoom(room.getNode());
   // ...
   int maxUsers = mucRoom.getMaxUsers(); // always 30 in this handler
   // ...
}

But in handler on changing room settings, maxUsers is correct.

Are the roomCreated handler be called before the chatroom settings applied or what else?

#OpenFire v 4.2.3

I hope it’ll help for other who faced with this issue.

To solve the problem, I called methods from a Thread with a little delay (100-200 ms) at beginning.