The method you are using is for the use case described in Example 16.:
XEP-0045: Multi-User Chat
An entity may also query a contact regarding which rooms the contact is in. This is done by querying the contact’s full JID (<user@host/resource>) while specifying the well-known Service Discovery node ‘http://jabber.org/protocol/muc#rooms’.
It requires the full JID of another contact/client to ask it, which chat rooms it has joined.
The stanza you have suggested is only for discovering support for MUC. See § 6.2.
Getting a list of rooms, you have joined should be handled in Smack somewhere. Using the getJoinedRooms with your own full JID (connected resource) should work as well, but would simply ask yourself.
Getting a list of rooms from the server, where you are member is not possible with XEP-0045.
Now I am using MultiUserChatManager.getHostedRooms(DomainBareJid serviceName) to get what I need.
In Xmpp document this is shown in Section 6.3 (XEP-0045: Multi-User Chat )
Request stanza:
Result stanza:
Note 1: There are other muc rooms in this Muc Service, but it is not listed in the result (because I am not a member of those rooms).
Note 2: In my Muc Service, all rooms are set to private. If there are public rooms, then they will be listed also (although I am not a member of these public rooms).
Your answer helped me to find which function to use, but it does not seem that getJoinedRooms(myJid) will give me the list of Rooms that I am a member of.
Am I using the correct function (getJoinedRooms) to get the Rooms that i am a member of?
No, use MultiUserChatManager.getJoinedRooms() (MultiUserChatManager (Smack 4.1.8 API) )