aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 9e4f15a36..d482b7326 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -660,6 +660,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
final MenuItem shareBarcode = menu.findItem(R.id.action_share_barcode);
final MenuItem shareQRCode = menu.findItem(R.id.action_show_qr_code);
final MenuItem announcePGP = menu.findItem(R.id.mgmt_account_announce_pgp);
+ final MenuItem forgotPassword = menu.findItem(R.id.mgmt_account_password_forgotten);
renewCertificate.setVisible(mAccount != null && mAccount.getPrivateKeyAlias() != null);
if (mAccount != null && mAccount.isOnlineAndConnected()) {
@@ -671,10 +672,12 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
reconnect.setVisible(true);
announcePGP.setVisible(true);
+ forgotPassword.setVisible(true);
mamPrefs.setVisible(mAccount.getXmppConnection().getFeatures().mam());
changePresence.setVisible(!mInitMode);
} else {
announcePGP.setVisible(false);
+ forgotPassword.setVisible(false);
reconnect.setVisible(false);
showBlocklist.setVisible(false);
showMoreInfo.setVisible(false);
@@ -885,10 +888,36 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
case R.id.mgmt_account_announce_pgp:
publishOpenPGPPublicKey(mAccount);
return true;
+ case R.id.mgmt_account_password_forgotten:
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.password_forgotten_title);
+ builder.setMessage(R.string.password_forgotten_text);
+ builder.setNegativeButton(R.string.cancel, null);
+ builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
+ try {
+ Uri uri = Uri.parse(getSupportSite(mAccount.getJid().getDomain()));
+ final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+ startActivity(intent);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ });
+ builder.create().show();
}
return super.onOptionsItemSelected(item);
}
+ private String getSupportSite(String domain) {
+ int i = -1;
+ for (String domains: getResources().getStringArray(R.array.support_domains)) {
+ i++;
+ if (domains.equals(domain)) {
+ return getResources().getStringArray(R.array.support_site)[i];
+ }
+ }
+ return domain;
+ }
+
private boolean inNeedOfSaslAccept() {
return mAccount != null && mAccount.getLastErrorStatus() == Account.State.DOWNGRADE_ATTACK && mAccount.getKeyAsInt(Account.PINNED_MECHANISM_KEY, -1) >= 0 && !accountInfoEdited();
}