From 6a6112daeb5677594ab047f6fa6fe843b1b49f0c Mon Sep 17 00:00:00 2001 From: Christian S Date: Sat, 23 Apr 2016 15:33:25 +0200 Subject: Prevent presences from being cleared on connection Sometimes when enabling/reenabling accounts the initial presences that the server sends get cleared shortly after connecting. This might also be what caused siacs/Conversations#1705. This commit fixes the status inconsistencies I have experienced, though there might be more causes for the problems described in that issue. --- .../java/eu/siacs/conversations/services/XmppConnectionService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 82fe4a4e2..90e8470db 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -262,7 +262,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } } } - account.getRoster().clearPresences(); mJingleConnectionManager.cancelInTransmission(); fetchRosterFromServer(account); fetchBookmarks(account); @@ -2220,6 +2219,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa sendOfflinePresence(account); } account.getXmppConnection().disconnect(force); + account.getRoster().clearPresences(); } } @@ -2642,7 +2642,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa scheduleWakeUpCall(Config.CONNECT_DISCO_TIMEOUT, account.getUuid().hashCode()); } else { disconnect(account, force); - account.getRoster().clearPresences(); connection.resetEverything(); account.getAxolotlService().resetBrokenness(); } -- cgit v1.2.3