aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-04-09 12:46:54 +0200
committeriNPUTmice <daniel@gultsch.de>2015-04-09 12:46:54 +0200
commit332fe0fd194a80501cf935f22faed645f3032b57 (patch)
tree7733821f5ce527d08f3f828eaabe56e15df59c0e /src/main/java/eu/siacs/conversations/ui/SettingsActivity.java
parentf880473435b6c3167edc727eacccef377643a8c5 (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.java12
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);
+ }
}
}
}