we’ve got the fix with leaveSync() in join(). However this now presents another problem. If connection is interrupted (I simulate it by shutting and starting local XMPP server) then joined is still true in this if:
public synchronized void join(MucEnterConfiguration mucEnterConfiguration)
...
if (joined) {
try {
leaveSync();
}
and leaveSync() sends unavailable stanza and waits for response until timeout (30 sec in my case). If you have many MUCs you could wait a very long time before you join all of them.
Thank you Flow. I’ve crated a workaround where I loop through my chats and call leave() on each of them that has isJoined == true. Then later joining goes without delay. Works for now.