aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian S. <kriztan@users.noreply.github.com>2015-10-03 16:37:51 +0200
committerChristian S. <kriztan@users.noreply.github.com>2015-10-03 16:37:51 +0200
commite2f48966df6781b4c0a18980c1d41a45bfa328a9 (patch)
tree516ec77de9d671a79f6eb71e13f9c588749059a6
parentdca17b4191e6d68785d7e3534b513c7bafbf85db (diff)
parent2b9b700c96f7dc0df852a55b115a61d5573bb872 (diff)
Merge pull request #43 from siacs/master
copy commits
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index fe5272b00..2f00083f8 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);
@@ -1471,20 +1471,22 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
private void connectMultiModeConversations(Account account) {
List<Conversation> conversations = getConversations();
for (Conversation conversation : conversations) {
- if ((conversation.getMode() == Conversation.MODE_MULTI)
- && (conversation.getAccount() == account)) {
- conversation.resetMucOptions();
- joinMuc(conversation);
+ if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getAccount() == account) {
+ 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);
if (joinJid == null) {