aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-11 16:49:42 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-11 16:49:42 +0100
commit11a8a747e37cc643d19855271ede5a9ad752f71d (patch)
tree42f658a7fc8706e9b31eb40b099247abd2d20c84 /src
parent838270432f5f4fbbdcc98ac7019c7baa4b666210 (diff)
fixed bug with disabling accounts
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java11
-rw-r--r--src/eu/siacs/conversations/ui/ManageAccountActivity.java1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index da8129c4..5fa0c850 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -292,7 +292,7 @@ public class XmppConnectionService extends Service {
// TODO: ask user to handle it maybe
}
} else {
- Log.d(LOGTAG, packet.toString());
+ //Log.d(LOGTAG, packet.toString());
}
replaceContactInConversation(contact.getJid(), contact);
}
@@ -414,9 +414,15 @@ public class XmppConnectionService extends Service {
if (!account.isOptionSet(Account.OPTION_DISABLED)) {
if (!isConnected) {
account.setStatus(Account.STATUS_NO_INTERNET);
+ if (statusListener!=null) {
+ statusListener.onStatusChanged(account);
+ }
} else {
if (account.getStatus() == Account.STATUS_NO_INTERNET) {
account.setStatus(Account.STATUS_OFFLINE);
+ if (statusListener!=null) {
+ statusListener.onStatusChanged(account);
+ }
}
// TODO 3 remaining cases
@@ -440,6 +446,7 @@ public class XmppConnectionService extends Service {
new Thread(account.getXmppConnection()).start();
} else {
Log.d(LOGTAG,account.getJid()+": status="+account.getStatus());
+ // TODO notify user of ssl cert problem or auth problem or what ever
}
//in any case. reschedule wakup call
this.scheduleWakeupCall(PING_MAX_INTERVAL, true);
@@ -1053,7 +1060,7 @@ public class XmppConnectionService extends Service {
}
public void disconnect(final Account account, boolean blocking) {
- if (account.getStatus() == Account.STATUS_ONLINE) {
+ if ((account.getStatus() == Account.STATUS_ONLINE)||(account.getStatus() == Account.STATUS_DISABLED)) {
List<Conversation> conversations = getConversations();
for (int i = 0; i < conversations.size(); i++) {
Conversation conversation = conversations.get(i);
diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
index 2af69867..85998131 100644
--- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
@@ -48,7 +48,6 @@ public class ManageAccountActivity extends XmppActivity {
@Override
public void onAccountListChangedListener() {
- Log.d("xmppService", "ui on account list changed listener");
accountList.clear();
accountList.addAll(xmppConnectionService.getAccounts());
runOnUiThread(new Runnable() {