aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java13
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java2
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 b7ac7571b..33f7210f7 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 889457ffb..6be220c72 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);
}
}
}