diff options
author | iNPUTmice <daniel@gultsch.de> | 2015-04-09 12:46:54 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2015-04-09 12:46:54 +0200 |
commit | 332fe0fd194a80501cf935f22faed645f3032b57 (patch) | |
tree | 7733821f5ce527d08f3f828eaabe56e15df59c0e /src/main/java/eu/siacs/conversations/ui/SettingsActivity.java | |
parent | f880473435b6c3167edc727eacccef377643a8c5 (diff) |
don't resume old session when changing resource
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/SettingsActivity.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/SettingsActivity.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index 39e215f2b..e3cb2ee79 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.Locale; import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.xmpp.XmppConnection; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; @@ -63,9 +64,14 @@ public class SettingsActivity extends XmppActivity implements .toLowerCase(Locale.US); if (xmppConnectionServiceBound) { for (Account account : xmppConnectionService.getAccounts()) { - account.setResource(resource); - if (!account.isOptionSet(Account.OPTION_DISABLED)) { - xmppConnectionService.reconnectAccountInBackground(account); + if (account.setResource(resource)) { + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + XmppConnection connection = account.getXmppConnection(); + if (connection != null) { + connection.resetStreamId(); + } + xmppConnectionService.reconnectAccountInBackground(account); + } } } } |