Discover MUCs from full JID

43 views
Skip to first unread message

Jorge Sasiain

unread,
Jun 17, 2017, 8:41:27 PM6/17/17
to Strophe
Hello everyone. I'm building a XMPP application with Strophe and I'd like to ask for help on a specific issue. This is a question that I posted in stackoverflow a few days ago; however, I didn't get any answer, so I'm hoping for better luck here!

Basically, the goal is to obtain the MUCs (group chats) that a given user is connected to.

I'm using the XMPP client Profanity to connect with my XMPP account and successfully join a MUC that I've created. Profanity tells me the full JID I'm connected with, including the resource name (<user@host/resource>).

I was following the specification XEP-0045: Multi-User Chat, and it says that you should first use service discovery to check if the user's client supports the MUC service. This is done by sending an IQ stanza to the user's full JID with the namespace http://jabber.org/protocol/disco#info.

Just like in the specification, the response I'm getting includes the <feature var='http://jabber.org/protocol/muc'/> line, so I go ahead and ask for the MUCs. According to the specification:

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'.

This is the IQ stanza I'm sending with strophe:

   
 $iq({'type':'get', 'to':XMPP.jid, 'id':'rooms2'}).c('query', {'xmlns':Strophe.NS.DISCO_ITEMS, 'node':'http://jabber.org/protocol/muc#rooms'});

However, when I do that, I don't receive any <item> element in the response like in the example response shown in the specification. This is despite the fact that I'm still connected with this full JID to a MUC in the Profanity client. 

I tried everything again with a different client, Conversations, (and therefore a different full JID), as well as with a different XMPP account (in a different server), but still the same empty result everytime, despite being told from the service discovery query that the user supports MUC.

Does anyone know if there is a solution to this? Is there any other way to query the MUCs that a XMPP user is connected to?

Thanks in advance!
Reply all
Reply to author
Forward
0 new messages