diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-05-20 22:47:52 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-05-20 22:47:52 +0200 |
commit | d3728e504f9673e97536d9bd519097c3df961035 (patch) | |
tree | 00207e961ca1f49d83a6c5f3a43289fabb0e8145 /src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | |
parent | 893a1a0958d4b9f6d3ba5f81ee29b9341fdc07c5 (diff) | |
parent | 9ce2cfa3d2e8aac80f8e73855a879baad78dad0d (diff) |
Merge remote-tracking branch 'refs/remotes/siacs/master'
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 57d3f9550..15701c950 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -507,6 +507,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate final MenuItem showBlocklist = menu.findItem(R.id.action_show_block_list); final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more); final MenuItem changePassword = menu.findItem(R.id.action_change_password_on_server); + final MenuItem showPassword = menu.findItem(R.id.action_show_password); final MenuItem clearDevices = menu.findItem(R.id.action_clear_devices); final MenuItem renewCertificate = menu.findItem(R.id.action_renew_certificate); final MenuItem mamPrefs = menu.findItem(R.id.action_mam_prefs); @@ -535,6 +536,13 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate mamPrefs.setVisible(false); changePresence.setVisible(false); } + + if (mAccount != null) { + showPassword.setVisible(mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) + && !mAccount.isOptionSet(Account.OPTION_REGISTER)); + } else { + showPassword.setVisible(false); + } return super.onCreateOptionsMenu(menu); } @@ -651,6 +659,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate case R.id.action_change_presence: changePresence(); break; + case R.id.action_show_password: + showPassword(); + break; } return super.onOptionsItemSelected(item); } @@ -909,6 +920,17 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate xmppConnectionService.fetchMamPreferences(mAccount, this); } + private void showPassword() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + View view = getLayoutInflater().inflate(R.layout.dialog_show_password, null); + TextView password = (TextView) view.findViewById(R.id.password); + password.setText(mAccount.getPassword()); + builder.setTitle(R.string.password); + builder.setView(view); + builder.setPositiveButton(R.string.cancel, null); + builder.create().show(); + } + @Override public void onKeyStatusUpdated(AxolotlService.FetchStatus report) { refreshUi(); |