0
votes

For persistent XMPP rooms, what is the way to make a client join back the room again if he / she has disconnected once? During testing, I find that simply sending back the presence stanza to the said room's JID does not make the client be available in the room again. Does re-entering a room happen only when a user has received an invite (and thus, in our case, if the user disconnects once, the user would need another invite to join the room?)?

If that is the case, then what is the best way to implement the auto-generation of such invites for original room participants who are reconnecting?

Thanks.

2
Without invitation I don't think it's possible but you can setup a listener and invite the leaving user back into the room.Moatez Bouhdid
Thanks @MoatezBouhdid - tried sending the invite manually back too but the leaving user just wouldnt join! :-(vikram17000
Was able to get the user to rejoin without the invite - just had to re-join at the right place...vikram17000

2 Answers

0
votes

Best way it's to use pubsub feature and relative MultiUserChat bookmarks. You can develop a custom bookmarks manager if you need something declined on your special needs.

Do you need the following steps:

1) When create a persistent groupchat, bookmark the groupchat after first join. (=> save on db groupchat name and password)

2) When recive an invite, bookmark the groupchat after the first join (=> save on db groupchat name and password)

3) On login / reconnect retrive bookmarks list

4) Foreach bookmark -> join (and assign listeners and so on)

5) Provide a delete bookmark condition (based on timestamp, session, explicit request and so on).

Official specifications

0
votes

There is a proposed XEP and it's implemented in latest ejabberd which supports subscriptions. It expose MUC rooms as pubsub nodes to introduce the concept of MUC rooms subscribers.