diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-02-17 16:50:48 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-02-17 16:50:48 +0100 |
commit | 3626e4b3a0d3d3da4be1bdf7645045d8cf892b50 (patch) | |
tree | 2c53f422e98ee7e23d0f19947fe4f143f81ea3f8 /src/main/java/eu | |
parent | c2fbdbde830fb3f15e4bdd1c1fb904e69b68927e (diff) |
fixed regression that caused messages in muc not being send
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 13 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index b7ac7571..33f7210f 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -287,7 +287,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } List<Conversation> conversations = getConversations(); for (Conversation conversation : conversations) { - if (conversation.getAccount() == account && conversation.getMode() == Conversation.MODE_SINGLE) { + if (conversation.getAccount() == account + && !account.pendingConferenceJoins.contains(conversation)) { if (!conversation.startOtrIfNeeded()) { Log.d(Config.LOGTAG,account.getJid().toBareJid()+": couldn't start OTR with "+conversation.getContact().getJid()+" when needed"); } @@ -1757,20 +1758,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, true, null); + joinMuc(conversation); } } } public void joinMuc(Conversation conversation) { - joinMuc(conversation, false, null); + joinMuc(conversation, null); } - private void joinMuc(Conversation conversation, boolean now, final OnConferenceJoined onConferenceJoined) { + private void joinMuc(Conversation conversation, final OnConferenceJoined onConferenceJoined) { Account account = conversation.getAccount(); account.pendingConferenceJoins.remove(conversation); account.pendingConferenceLeaves.remove(conversation); - if (account.getStatus() == Account.State.ONLINE || now) { + if (account.getStatus() == Account.State.ONLINE) { conversation.resetMucOptions(); fetchConferenceConfiguration(conversation, new OnConferenceConfigurationFetched() { @@ -1949,7 +1950,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa String name = new BigInteger(75, getRNG()).toString(32); Jid jid = Jid.fromParts(name, server, null); final Conversation conversation = findOrCreateConversation(account, jid, true); - joinMuc(conversation, true, new OnConferenceJoined() { + joinMuc(conversation, new OnConferenceJoined() { @Override public void onConferenceJoined(final Conversation conversation) { Bundle options = new Bundle(); diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 889457ff..6be220c7 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1077,10 +1077,10 @@ public class XmppConnection implements Runnable { if (mPendingServiceDiscoveries == 0) { Log.d(Config.LOGTAG,account.getJid().toBareJid()+": done with service discovery"); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": online with resource " + account.getResource()); - changeStatus(Account.State.ONLINE); if (bindListener != null) { bindListener.onBind(account); } + changeStatus(Account.State.ONLINE); } } } |