Project

General

Profile

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='user@domain.com' 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"

Thanks.


Replies (1)

Avatar?id=6023&size=32x32

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.

    (1-1/1)