1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 00:02:06 +01:00

Update disco.md

This commit is contained in:
Jesus Fuentes 2018-04-03 08:46:50 -05:00
parent 32f8c345fb
commit 9bd88e0df5

View file

@ -93,10 +93,11 @@ ServiceDiscoveryManager.getInstanceFor(connection).setNodeInformationProvider(
"http://jabber.org/protocol/muc#rooms", "http://jabber.org/protocol/muc#rooms",
new NodeInformationProvider() { new NodeInformationProvider() {
public List<DiscoverItems.Item> getNodeItems() { public List<DiscoverItems.Item> getNodeItems() {
MultiUserChatManager mucManager = MultiUserChatManager.getInstanceFor(connection);
List<DiscoverItems.Item> answer = new ArrayList<>(); List<DiscoverItems.Item> answer = new ArrayList<>();
Iterator rooms = MultiUserChat.getJoinedRooms(connection); Iterator<Jid> rooms = mucManager.getJoinedRooms().iterator();
while (rooms.hasNext()) { while (rooms.hasNext()) {
answer.add(new DiscoverItems.Item((String)rooms.next())); answer.add(new DiscoverItems.Item(rooms.next()));
} }
return answer; return answer;
} }