Change summary
src/main/java/eu/siacs/conversations/Config.java | 1
src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 8
2 files changed, 6 insertions(+), 3 deletions(-)
Detailed changes
@@ -113,6 +113,7 @@ public final class Config {
public static final boolean ONLY_INTERNAL_STORAGE = false; //use internal storage instead of sdcard to save attachments
public static final boolean IGNORE_ID_REWRITE_IN_MUC = true;
+ public static final boolean MUC_LEAVE_BEFORE_JOIN = true;
public static final long MAM_MAX_CATCHUP = MILLISECONDS_IN_DAY * 5;
public static final int MAM_MAX_MESSAGES = 750;
@@ -1395,7 +1395,7 @@ public class XmppConnectionService extends Service {
final boolean inProgressJoin;
synchronized (account.inProgressConferenceJoins) {
- inProgressJoin = conversation.getMode() == Conversational.MODE_MULTI && account.inProgressConferenceJoins.contains(conversation);
+ inProgressJoin = conversation.getMode() == Conversational.MODE_MULTI && (account.inProgressConferenceJoins.contains(conversation) || account.pendingConferenceJoins.contains(conversation));
}
if (account.isOnlineAndConnected() && !inProgressJoin) {
@@ -2546,8 +2546,10 @@ public class XmppConnectionService extends Service {
synchronized (account.inProgressConferenceJoins) {
account.inProgressConferenceJoins.add(conversation);
}
- sendPresencePacket(account, mPresenceGenerator.leave(conversation.getMucOptions()));
- conversation.resetMucOptions();
+ if (Config.MUC_LEAVE_BEFORE_JOIN) {
+ sendPresencePacket(account, mPresenceGenerator.leave(conversation.getMucOptions()));
+ }
+ conversation.resetMucOptions();
if (onConferenceJoined != null) {
conversation.getMucOptions().flagNoAutoPushConfiguration();
}