How to get rooms that I am a member of?

Matthew M
Added over 4 years ago

We would like to create a customized IQ that to quickly get all the rooms that I am a member of. I wonder what would be the best way to write a query to fetch these room JIDs, give a user JID?

The tigase DB tables is a bit hard to understand, I finally managed to write a query like this:

select node as roomname from tig_nodes where nid in 
    (select parent_nid from tig_nodes where nid in 
    (select nid from tig_pairs where pkey='' and pval <> 'outcast')

This query looks horrible to me and must be very inefficient.... Would really appreciate if you could advise that what's the best way to query "my-rooms"


Replies (1)


Added by Artur Hefczyc TigaseTeam over 4 years ago

I am afraid, that right now, this is the only way. MUC uses our generic user repository interface which is convenient to use but not optimal for some use-cases. We will be adding a dedicated DB schema for MUC as we just did for PubSub.