diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-10-01 16:01:19 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-10-01 16:01:19 +0200 |
commit | 2b9b700c96f7dc0df852a55b115a61d5573bb872 (patch) | |
tree | b893459e573aa93c243da74e8e1d4b82cf14f1e1 | |
parent | 6a0b9971aa81504e2b52c67e793efce5071e8c9f (diff) |
don't put conference joins into pending on initial bind
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index dabfff4d..2f00083f 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -154,14 +154,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa fetchBookmarks(account); sendPresence(account); connectMultiModeConversations(account); - for (Conversation conversation : account.pendingConferenceLeaves) { - leaveMuc(conversation); - } - account.pendingConferenceLeaves.clear(); - for (Conversation conversation : account.pendingConferenceJoins) { - joinMuc(conversation); - } - account.pendingConferenceJoins.clear(); mMessageArchiveService.executePendingQueries(account); mJingleConnectionManager.cancelInTransmission(); syncDirtyContacts(account); @@ -273,6 +265,14 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa sendUnsentMessages(conversation); } } + for (Conversation conversation : account.pendingConferenceLeaves) { + leaveMuc(conversation); + } + account.pendingConferenceLeaves.clear(); + for (Conversation conversation : account.pendingConferenceJoins) { + joinMuc(conversation); + } + account.pendingConferenceJoins.clear(); scheduleWakeUpCall(Config.PING_MAX_INTERVAL, account.getUuid().hashCode()); } else if (account.getStatus() == Account.State.OFFLINE) { resetSendingToWaiting(account); @@ -1472,17 +1472,20 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa List<Conversation> conversations = getConversations(); for (Conversation conversation : conversations) { if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getAccount() == account) { - joinMuc(conversation); + joinMuc(conversation,true); } } } - public void joinMuc(Conversation conversation) { + joinMuc(conversation,false); + } + + private void joinMuc(Conversation conversation, boolean now) { Account account = conversation.getAccount(); account.pendingConferenceJoins.remove(conversation); account.pendingConferenceLeaves.remove(conversation); - if (account.getStatus() == Account.State.ONLINE) { + if (account.getStatus() == Account.State.ONLINE || now) { conversation.resetMucOptions(); final String nick = conversation.getMucOptions().getProposedNick(); final Jid joinJid = conversation.getMucOptions().createJoinJid(nick); |