Hi,
I’m trying to get a list of rooms available to a user using smack 4.3.1
this is the function I’m using at the moment
public void getRoomlist ()
{
MultiUserChatManager multiChat = MultiUserChatManager.getInstanceFor(connection);
Set rooms = multiChat.getJoinedRooms();
System.out.println("Rooms: " + rooms.size());
for (EntityBareJid room : rooms)
{
System.out.println(room.toString());
}
}
however it doesn’t list any rooms for a user I know should be able to access 2
I’m not sure if I’ve made an error or not, so any help is appreciated
pheonixfire
Flow
February 16, 2019, 10:29am
2
The method getJoinedRooms()
returns the list of currently joined rooms, not the list of all (accessible|available) rooms. It sounds like you want to call getRoomsHostedBy()
with the local MUC service as argument.
could you provide an example of how to retrieve this info, I haven’t used the map data type
before so I’m a little unsure how to use it
any help is appreciated
pheonixfire
Flow
February 16, 2019, 5:48pm
4
Well the returned Map “maps” the XMPP addresses (aka “JIDs”) of the hosted rooms to a class which holds further information about that room.
Ah, so it works similar to a json data type then
Thanks
pheonixfire
system
Closed
April 19, 2019, 11:40pm
6
This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.