aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-08-13 18:25:10 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-08-15 16:57:07 +0200
commit83e1e6468e1ade8f70601195e8c0f2435fec9b25 (patch)
tree026806cd1d3038e87d12396b2f417ddaffe52b4e /src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
parent32826ec29d28668b7f345ffcd45cd876dc980153 (diff)
fully depend on sm
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index a9a2f211..92d99222 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -149,14 +149,25 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
@Override
public void onBind(final Account account) {
+ resetSendingToWaiting(account);
account.getRoster().clearPresences();
- account.pendingConferenceJoins.clear();
- account.pendingConferenceLeaves.clear();
fetchRosterFromServer(account);
fetchBookmarks(account);
sendPresence(account);
connectMultiModeConversations(account);
- updateConversationUi();
+ 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);
+ account.getAxolotlService().publishOwnDeviceIdIfNeeded();
+ account.getAxolotlService().publishBundlesIfNeeded();
}
};
private final OnMessageAcknowledged mOnMessageAcknowledgedListener = new OnMessageAcknowledged() {
@@ -248,14 +259,15 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
mOnAccountUpdate.onAccountUpdate();
}
if (account.getStatus() == Account.State.ONLINE) {
- for (Conversation conversation : account.pendingConferenceLeaves) {
- leaveMuc(conversation);
- }
- for (Conversation conversation : account.pendingConferenceJoins) {
- joinMuc(conversation);
+ if (connection != null && connection.getFeatures().csi()) {
+ if (checkListeners()) {
+ Log.d(Config.LOGTAG, account.getJid().toBareJid()+ " sending csi//inactive");
+ connection.sendInactive();
+ } else {
+ Log.d(Config.LOGTAG, account.getJid().toBareJid()+ " sending csi//active");
+ connection.sendActive();
+ }
}
- mMessageArchiveService.executePendingQueries(account);
- mJingleConnectionManager.cancelInTransmission();
List<Conversation> conversations = getConversations();
for (Conversation conversation : conversations) {
if (conversation.getAccount() == account) {
@@ -263,21 +275,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
sendUnsentMessages(conversation);
}
}
- if (connection != null && connection.getFeatures().csi()) {
- if (checkListeners()) {
- Log.d(Config.LOGTAG, account.getJid().toBareJid()
- + " sending csi//inactive");
- connection.sendInactive();
- } else {
- Log.d(Config.LOGTAG, account.getJid().toBareJid()
- + " sending csi//active");
- connection.sendActive();
- }
- }
- syncDirtyContacts(account);
- account.getAxolotlService().publishOwnDeviceIdIfNeeded();
- account.getAxolotlService().publishBundlesIfNeeded();
-
scheduleWakeUpCall(Config.PING_MAX_INTERVAL, account.getUuid().hashCode());
} else if (account.getStatus() == Account.State.OFFLINE) {
if (!account.isOptionSet(Account.OPTION_DISABLED)) {
@@ -859,7 +856,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster");
}
iqPacket.query(Xmlns.ROSTER).setAttribute("ver", account.getRosterVersion());
- sendIqPacket(account,iqPacket,mIqParser);
+ sendIqPacket(account, iqPacket, mIqParser);
}
public void fetchBookmarks(final Account account) {
@@ -1478,6 +1475,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
}
+
public void joinMuc(Conversation conversation) {
Account account = conversation.getAccount();
account.pendingConferenceJoins.remove(conversation);