diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-19 21:05:17 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-19 21:05:17 +0200 |
commit | 371c985c25d0b7ed348a1f2328673636acb939d7 (patch) | |
tree | 1cf341a3b6eaf43b33ffd031d82a1b42b403140c /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | a6f9a742c0dffeaa2f7fc26ad65e9c972a9d2288 (diff) |
made roster persistant aka enabled versioning again
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 5af53a3c..35e5fb51 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -616,14 +616,24 @@ public class XmppConnectionService extends Service { @Override public void onDestroy() { - Log.d(LOGTAG, "stopping service"); super.onDestroy(); + this.logoutAndSave(); + } + + @Override + public void onTaskRemoved(Intent rootIntent) { + super.onTaskRemoved(rootIntent); + this.logoutAndSave(); + } + + private void logoutAndSave() { for (Account account : accounts) { databaseBackend.writeRoster(account.getRoster()); if (account.getXmppConnection() != null) { disconnect(account, true); } } + Log.d(LOGTAG,"good bye"); } protected void scheduleWakeupCall(int seconds, boolean ping) { |