Page 1 of 1

Suggestion: customize initial roomlist

Posted: 04 Jun 2019, 09:47
by Rob
Could there be a way in a custom login to populate the initial roomlist with specific room groups? At the moment there's no way to specify what room groups individual users subscribes to. There's only the global "Default Room Groups" setting which applies to all users.

At the moment, we have to call subscribeRoomGroup for each group we want to join a specific user to, which in turn causes a ROOM_GROUP_SUBSCRIBE event for each group to be sent to the user. It would be more efficient to be able to include the relevant groups in the login reply.

Re: Suggestion: customize initial roomlist

Posted: 04 Jun 2019, 12:49
by Lapo
Hi,
you can configure the Default Room Groups to nothing (i.e. an empty string) so that when a User logs in the initial Room List is completely empty. Then you can apply your own custom logic to decide which Room Groups a certain User should subscribe to.

Hope it helps.

Re: Suggestion: customize initial roomlist

Posted: 04 Jun 2019, 14:33
by Rob
Yes, that's what I'm currently doing. But that leads to multiple ROOM_GROUP_SUBSCRIBE events having to be sent to the user after processing the login. My suggestion was to add functionality to the custom login to subscribe the user to those groups immediately on login so that the LOGIN response will have all the rooms from those groups instead of an empty roomlist.

If the user needs to join 5 room groups, the current solution causes 5 extra events to be sent instead of having them all be included in the original login reply.

Maybe make it so we can call user.subscribeGroup() in our custom login handler and that would make sure the user's login reply would have the rooms added, just as if they were in the Default Room Groups setting.

Re: Suggestion: customize initial roomlist

Posted: 05 Jun 2019, 08:23
by Lapo
Makes sense, I've added a note in our TODO database.
Thanks