[Help/Example] How to get list of opened chats and chat rooms? 4.2.0beta3

iHello everybody! For example, In Pidgin for Windows, after logging I get list of chats and chat rooms. How can I achieve this? I know that it’s only list of Jids.

Please, give me any idea or snippet that can be useful.

Thank you!