aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-18 22:38:07 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-18 22:38:07 +0100
commit54f1422d3d076b7e96cf2c03c61cf75affaf43e7 (patch)
treea6870ebc71ed2987cf55625fa895dcbdf66912e7 /src/main/java/de/pixart/messenger/services
parentd9659fc3667cff043c922c5132f52bd5defc36fe (diff)
put omemo fingerprint in own uri (qr code / nfc)
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 5fb90d822..92b288494 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -3771,6 +3771,28 @@ public class XmppConnectionService extends Service {
}
}
+ public boolean verifyFingerprints(Account account, List<XmppUri.Fingerprint> fingerprints) {
+ final AxolotlService axolotlService = account.getAxolotlService();
+ boolean verifiedSomething = false;
+ for(XmppUri.Fingerprint fp : fingerprints) {
+ if (fp.type == XmppUri.FingerprintType.OMEMO) {
+ String fingerprint = "05"+fp.fingerprint.replaceAll("\\s","");
+ Log.d(Config.LOGTAG,"trying to verify own fp="+fingerprint);
+ FingerprintStatus fingerprintStatus = axolotlService.getFingerprintTrust(fingerprint);
+ if (fingerprintStatus != null) {
+ if (!fingerprintStatus.isVerified()) {
+ axolotlService.setFingerprintTrust(fingerprint,fingerprintStatus.toVerified());
+ verifiedSomething = true;
+ }
+ } else {
+ axolotlService.preVerifyFingerprint(account,fingerprint);
+ verifiedSomething = true;
+ }
+ }
+ }
+ return verifiedSomething;
+ }
+
public interface OnMamPreferencesFetched {
void onPreferencesFetched(Element prefs);
void onPreferencesFetchFailed();