I'm writing a website that uses ejabberd in the backend. I'm using the strophe JavaScript library to communicate with the ejabberd server from the browser. I also have a Java backend that communicates with the ejabberd server via smack API.
I'd like to find out what MUC rooms are owned by a particular user (using the JID, say). How can I accomplish this?
The room affiliations are
The room affiliations are stored per room. You would need to go room by room checking the affiliations, and then filter by the user JID.
thousands of rooms
Since there are thousands of rooms, it may be infeasible to browse each room to get the owner information. Is there anything else I can do to get this information quickly?
Two possibilities
Since there are thousands of rooms, it may be infeasible to browse each room to get the owner information. Is there anything else I can do to get this information quickly?
You could implement the room loop in erlang. Or extract the information when it's generated: when room affiliation changes, store that information in another table, for faster retrieval.