aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-09-06 15:08:42 +0200
committerAndreas Straub <andy@strb.org>2015-09-06 15:15:57 +0200
commita95c451f1e6ee69fbf3b0072d672c3609a4b1e7d (patch)
tree860e3300c65c837e4e4770a473e9f15cf6525886 /src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
parent2bb033267b80f8ee030a20e5c447df6a22226f61 (diff)
Only show that have sessions in fingerprint list
Doesn't access database directly anymore but goes through AxolotlService now to obtain list of fingerprints associated with an Account/Contact. This should prevent orphaned keys littering the UI which previously couldn't be removed through the Clear Devices function. Together with 1c79982da84964c1d81179a0927d9cd1eadf53de this fixes #1393
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 02b1d873..7b5dc9ab 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -25,8 +25,6 @@ import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
-import org.whispersystems.libaxolotl.IdentityKey;
-
import java.util.Set;
import eu.siacs.conversations.Config;
@@ -572,7 +570,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
} else {
this.mOtrFingerprintBox.setVisibility(View.GONE);
}
- final String axolotlFingerprint = this.mAccount.getAxolotlService().getOwnPublicKey().getFingerprint();
+ final String axolotlFingerprint = this.mAccount.getAxolotlService().getOwnFingerprint();
if (axolotlFingerprint != null) {
this.mAxolotlFingerprintBox.setVisibility(View.VISIBLE);
this.mAxolotlFingerprint.setText(CryptoHelper.prettifyFingerprint(axolotlFingerprint));
@@ -607,16 +605,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
} else {
this.mAxolotlFingerprintBox.setVisibility(View.GONE);
}
- final IdentityKey ownKey = mAccount.getAxolotlService().getOwnPublicKey();
+ final String ownFingerprint = mAccount.getAxolotlService().getOwnFingerprint();
boolean hasKeys = false;
keys.removeAllViews();
- for(final IdentityKey identityKey : xmppConnectionService.databaseBackend.loadIdentityKeys(
- mAccount, mAccount.getJid().toBareJid().toString())) {
- if(ownKey.equals(identityKey)) {
+ for (final String fingerprint : mAccount.getAxolotlService().getFingerprintsForOwnSessions()) {
+ if(ownFingerprint.equals(fingerprint)) {
continue;
}
- boolean highlight = identityKey.getFingerprint().replaceAll("\\s", "").equals(messageFingerprint);
- hasKeys |= addFingerprintRow(keys, mAccount, identityKey, highlight);
+ boolean highlight = fingerprint.equals(messageFingerprint);
+ hasKeys |= addFingerprintRow(keys, mAccount, fingerprint, highlight);
}
if (hasKeys) {
keysCard.setVisibility(View.VISIBLE);