diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-10-20 21:46:02 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-10-20 21:46:02 +0200 |
commit | 2693c655a64f5c858205d1112866cd8763f7103e (patch) | |
tree | 0a49d32f8ac54981bf302d230f877bf495eb18ce /src/main/java/de/pixart | |
parent | 076750c0a84498766d39fa3caf241dc380d21017 (diff) |
do not show 'open website' button after info has changed
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 3ac16ea2b..9d5bd279b 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -99,6 +99,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat public void onClick(final View v) { final String password = binding.accountPassword.getText().toString(); final boolean wasDisabled = mAccount != null && mAccount.getStatus() == Account.State.DISABLED; + final boolean accountInfoEdited = accountInfoEdited(); if (!mInitMode && passwordChangedInMagicCreateMode()) { gotoChangePassword(password); @@ -107,7 +108,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mInitMode && mAccount != null) { mAccount.setOption(Account.OPTION_DISABLED, false); } - if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !accountInfoEdited()) { + if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !accountInfoEdited) { mAccount.setOption(Account.OPTION_DISABLED, false); if (!xmppConnectionService.updateAccount(mAccount)) { Toast.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); @@ -123,7 +124,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } XmppConnection connection = mAccount == null ? null : mAccount.getXmppConnection(); - boolean openRegistrationUrl = registerNewAccount && mAccount != null && mAccount.getStatus() == Account.State.REGISTRATION_WEB; + boolean openRegistrationUrl = registerNewAccount && !accountInfoEdited && mAccount != null && mAccount.getStatus() == Account.State.REGISTRATION_WEB; boolean openPaymentUrl = mAccount != null && mAccount.getStatus() == Account.State.PAYMENT_REQUIRED; final boolean redirectionWorthyStatus = openPaymentUrl || openRegistrationUrl; URL url = connection != null && redirectionWorthyStatus ? connection.getRedirectionUrl() : null; @@ -488,7 +489,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } else { XmppConnection connection = mAccount == null ? null : mAccount.getXmppConnection(); URL url = connection != null && mAccount.getStatus() == Account.State.REGISTRATION_WEB ? connection.getRedirectionUrl() : null; - if (url != null && this.binding.accountRegisterNew.isChecked()) { + if (url != null && this.binding.accountRegisterNew.isChecked() && !accountInfoEdited) { this.binding.saveButton.setText(R.string.open_website); } else { this.binding.saveButton.setText(R.string.next); |