1

I know I can retrieve a list of public rooms from my server using:

<iq from='hag66@shakespeare.lit/pda'
    id='zb8q41f4'
    to='chat.shakespeare.lit'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

XEP-0045 - Discovering Rooms

However, I need a list of all rooms, regardless whether is public or private, and if is online of not.

Any suggestions, specially through XML?

Vitor Miranda
  • 135
  • 1
  • 1
  • 10
  • If the room is not configured with `muc#roomconfig_publicroom` then it won't show up in the service discovery - that's the whole point behind this configuration option. – Wojtek Sep 25 '19 at 21:26
  • They are not public. I know that using that code above I'm not supposed to retrieve that list. What i need is a way to retrieve the private ones. – Vitor Miranda Sep 25 '19 at 21:53

2 Answers2

1

They are not public. I know that using that code above I'm not supposed to retrieve that list. What i need is a way to retrieve the private ones.

When a MUC admin requests the list of rooms, he gets all the rooms, including the private ones.

You can also get the full list of rooms with this ejabberd command:

$ ejabberdctl muc_online_rooms muc.localhost
privateroomcreatedbyuser1@muc.localhost
privateroomcreatedbyuser3@muc.localhost
publicroomcreatedbyuser1@muc.localhost
publicroomcreatedbyuser3@muc.localhost

Those commands can be executed with XML-RPC or ReST calls if you enable the corresponding modules.

Badlop
  • 3,840
  • 1
  • 8
  • 9
0

If you are using Muc-Sub, then in ejabberd 21.04 there is a new api /api/get_user_subscriptions to get all the subscribed rooms list of a user. You can see Api Documentation