Getting the room names of owned rooms

hello!

as the subject says, i want to know if there’‘s a way of getting the list of room names (or room JID’‘s) that i own? the closest function i can think of is MultiUserChat.getRoomInfo, but the RoomInfo does not have information on the room’'s owner.

regards

ariel

Hi,

calling

MultiUserChat#getOwners()

will return you a collection of Affiliates. Using these you can then call

Affiliate#getAffiliation()

which will return you the possible affiliations such as “owner”, “admin”, “member”.

You can also call

Affiliate#getJid()

In order to match up with your own jid so you only get a match with rooms you own

hth

Jon

oh yeah thanks. i get it now. although my last question would be is that, in the smack API, the MultiUserChat.getOwners says that it would throw an XMPPException “if an error occured while performing the request to the server or you don’'t have enough privileges to get this information.” by privileges, does it mean i have to be an owner or admin in order to perform this function correctly?

thanks.

I’'m not entirely sure tbh, best way to find out would be to test and see if an exception is thrown if you do not have the correct privileges to to view the information.