How would you get a list of muc names?

I am using the smack api in combination with the wildfire server and I want to get a list of MUCs that already exist on the server how would I do that? I thought it would be the MultiUserChat.getHostedRooms() method but that doesn’'t seem to be returning the mucs. This is the list of Hosted Rooms I get back:

Room Name: Publish-Subscribe service

Room Name: Public Chatrooms

Room Name: User Search

and this is from the wildfire console

room description users

1 roomname roomname 1 / 30

2 roomname2 roomname2 1 / 30

So it is obvious that getHostedRooms() does not return the user created mucs.

Any help is appreciated.



You first need to use the ServiceDiscoveryManager to discover the items on the entity that corresponds to the server’'s service name. From this list, you grab the ones that contain feature, as these are the muc service providers. Then you use the ServiceDiscoveryManager again to find out what items each of the muc providers host. These last items are the rooms proper.