Remove the room from list after user leaving a room

As we know, When an user connect to the openfire server, the client will send an stanza for querying how many MUC rooms the user have been joined.

The query request like this:

<iq id="bdbb0ca9-cec4-4c60-87e1-92b3ed0f5ea5" to="conference.example.com" type="get" xmlns="jabber:client"><query xmlns="http://jabber.org/protocol/disco#items"/></iq>

and then , the response should be like this:

<iq xmlns="jabber:client" type="result" id="bdbb0ca9-cec4-4c60-87e1-92b3ed0f5ea5" from="conference.example.com" to="31304@example.com/3met8pnczi">
	<query xmlns="http://jabber.org/protocol/disco#items">
		<item jid="9988699_6vrt9eay@conference.example.com" name="Room A"/>
		<item jid="6998354_rvge9jui@conference.example.com" name="Room B"/>
	</query>
</iq>

If user leaves a room, the client will send a stanza:

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'
    type='unavailable'/>

The question is, the room which user leaved is still in the room list. It will always be found when user connect to openfire. Does somebody know is there any way to remove the room from the list?

The query does not return the rooms where the user is joined, but the list of all public rooms.

2 Likes

How could I get the joined rooms?

I don’t think it’s possible, but you can read through https://xmpp.org/extensions/xep-0045.html yourself, maybe you can find something.

The only thing I’ve found is to query other contacts with the node “http://jabber.org/protocol/muc#rooms”.
See Example 16. But it’s client-to-client, not to server.

Actually I think the specification could specify it for a MUC service as well, but unfortunately it doesn’t.

Thanks you very much! Let me see the Example 16. Could you leave your twitter for me?