diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-29 21:39:50 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-29 21:39:50 +0100 |
commit | bdda426ad4223773b5873ee20db22a22dff0e49b (patch) | |
tree | 0f958c1e14690a9731429ba5f1d801c5c94fb96b /src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | |
parent | 9671783d5bf7e2b8cf543b03b13fd292c2183614 (diff) |
allow fingerprint verification via context menu
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 7e3417a6e..2617fd94c 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -53,6 +53,7 @@ import de.pixart.messenger.services.XmppConnectionService.OnCaptchaRequested; import de.pixart.messenger.ui.adapter.KnownHostsAdapter; import de.pixart.messenger.utils.CryptoHelper; import de.pixart.messenger.utils.UIHelper; +import de.pixart.messenger.utils.XmppUri; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnKeyStatusUpdated; import de.pixart.messenger.xmpp.XmppConnection; @@ -383,13 +384,24 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_BATTERY_OP || requestCode == REQUEST_DATA_SAVER) { updateAccountInformation(mAccount == null); } } + @Override + protected void processFingerprintVerification(XmppUri uri) { + if (mAccount != null && mAccount.getJid().toBareJid().equals(uri.getJid()) && uri.hasFingerprints()) { + if (xmppConnectionService.verifyFingerprints(mAccount,uri.getFingerprints())) { + Toast.makeText(this,R.string.verified_fingerprints,Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(this,R.string.invalid_barcode,Toast.LENGTH_SHORT).show(); + } + } + protected void updateSaveButton() { boolean accountInfoEdited = accountInfoEdited(); @@ -671,6 +683,10 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat this.mPassword.requestFocus(); } } + if (mPendingFingerprintVerificationUri != null) { + processFingerprintVerification(mPendingFingerprintVerificationUri); + mPendingFingerprintVerificationUri = null; + } updateAccountInformation(init); } |