diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-04 21:44:16 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-04 21:44:16 +0100 |
commit | 4fd8620c6cc1ca88c4496671e6e59c40aba93019 (patch) | |
tree | 1e5063ec85002960036e39071ae210903167b7d5 /src/de/gultsch/chat/services | |
parent | 0d80d88736926d06e97f22f9ecc63d4fb696751c (diff) |
allow to temporarily disable accounts
Diffstat (limited to '')
-rw-r--r-- | src/de/gultsch/chat/services/XmppConnectionService.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java index fbbaca5c..ae1140ee 100644 --- a/src/de/gultsch/chat/services/XmppConnectionService.java +++ b/src/de/gultsch/chat/services/XmppConnectionService.java @@ -95,8 +95,11 @@ public class XmppConnectionService extends Service { public int onStartCommand(Intent intent, int flags, int startId) { for (Account account : accounts) { if (!connections.containsKey(account)) { - - this.connections.put(account, this.createConnection(account)); + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + this.connections.put(account, this.createConnection(account)); + } else { + Log.d(LOGTAG,account.getJid()+": not starting because it's disabled"); + } } } return START_STICKY; @@ -253,7 +256,11 @@ public class XmppConnectionService extends Service { connection.disconnect(); this.connections.remove(account); } - this.connections.put(account, this.createConnection(account)); + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + this.connections.put(account, this.createConnection(account)); + } else { + Log.d(LOGTAG,account.getJid()+": not starting because it's disabled"); + } if (accountChangedListener!=null) accountChangedListener.onAccountListChangedListener(); } |