diff options
Diffstat (limited to '')
3 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 716a39434..25ecf8506 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -2103,17 +2103,14 @@ public class XmppConnectionService extends Service { public void updateAccountPasswordOnServer(final Account account, final String newPassword, final OnAccountPasswordChanged callback) { final IqPacket iq = getIqGenerator().generateSetPassword(account, newPassword); - sendIqPacket(account, iq, new OnIqPacketReceived() { - @Override - public void onIqPacketReceived(final Account account, final IqPacket packet) { - if (packet.getType() == IqPacket.TYPE.RESULT) { - account.setPassword(newPassword); - account.setOption(Account.OPTION_MAGIC_CREATE, false); - databaseBackend.updateAccount(account); - callback.onPasswordChangeSucceeded(); - } else { - callback.onPasswordChangeFailed(); - } + sendIqPacket(account, iq, (a, packet) -> { + if (packet.getType() == IqPacket.TYPE.RESULT) { + a.setPassword(newPassword); + a.setOption(Account.OPTION_MAGIC_CREATE, false); + databaseBackend.updateAccount(a); + callback.onPasswordChangeSucceeded(); + } else { + callback.onPasswordChangeFailed(); } }); } diff --git a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java index 5f1b5ba94..9525513aa 100644 --- a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java @@ -50,7 +50,7 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti void onBackendConnected() { this.mAccount = extractAccount(getIntent()); if (this.mAccount != null && this.mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE)) { - this.mCurrentPassword.setVisibility(View.GONE); + this.mCurrentPasswordLayout.setVisibility(View.GONE); } else { this.mCurrentPassword.setVisibility(View.VISIBLE); } diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 9a1eb696c..036ddabab 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -1014,7 +1014,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat this.binding.accountJid.setEnabled(editable); this.binding.accountJid.setFocusable(editable); this.binding.accountJid.setFocusableInTouchMode(editable); - + if (mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY)) { this.binding.accountPasswordLayout.setPasswordVisibilityToggleEnabled(true); } else { |