aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-08-31 15:20:44 +0200
committerChristian Schneppe <christian@pix-art.de>2019-08-31 15:20:44 +0200
commit4142360189a66efee8561fcbbef0963bce104348 (patch)
tree230d019c6effad1e9b1438f011148302c3b508ae /src
parent016124b548a81c34a8dd5572fa354eaf00dd058f (diff)
make config flag for leave before join
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/Config.java1
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java6
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java
index ccfc3e834..d6063ab19 100644
--- a/src/main/java/de/pixart/messenger/Config.java
+++ b/src/main/java/de/pixart/messenger/Config.java
@@ -130,6 +130,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;
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index bb7162bb3..5028fea28 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -1581,7 +1581,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) {
@@ -2819,7 +2819,9 @@ public class XmppConnectionService extends Service {
synchronized (account.inProgressConferenceJoins) {
account.inProgressConferenceJoins.add(conversation);
}
- sendPresencePacket(account, mPresenceGenerator.leave(conversation.getMucOptions()));
+ if (Config.MUC_LEAVE_BEFORE_JOIN) {
+ sendPresencePacket(account, mPresenceGenerator.leave(conversation.getMucOptions()));
+ }
conversation.resetMucOptions();
if (onConferenceJoined != null) {
conversation.getMucOptions().flagNoAutoPushConfiguration();