aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-11-15 15:14:21 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-11-15 15:14:21 +0100
commitd61b00604d9a04c7f4a3933e42eee746583ba643 (patch)
tree4a0f6e08e044e044eb41b102d0a453289ed9c3c2
parent05fc15be3d45815e98f3d1fe0b527990fccf4fa6 (diff)
fixed enabling trust toggle. unknown->untrusted
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/FingerprintStatus.java6
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/FingerprintStatus.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/FingerprintStatus.java
index 666f171f..15bd9542 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/FingerprintStatus.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/FingerprintStatus.java
@@ -74,7 +74,11 @@ public class FingerprintStatus {
}
public boolean isTrusted() {
- return trust == Trust.TRUSTED || trust == Trust.VERIFIED || trust == Trust.VERIFIED_X509;
+ return trust == Trust.TRUSTED || isVerified();
+ }
+
+ public boolean isVerified() {
+ return trust == Trust.VERIFIED || trust == Trust.VERIFIED_X509;
}
public boolean isCompromised() {
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 144febdf..1454381a 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -795,7 +795,7 @@ public abstract class XmppActivity extends Activity {
new View.OnClickListener() {
@Override
public void onClick(View v) {
- account.getAxolotlService().setFingerprintTrust(fingerprint,FingerprintStatus.createActive(true));
+ account.getAxolotlService().setFingerprintTrust(fingerprint,FingerprintStatus.createActive(false));
v.setEnabled(true);
}
},
@@ -835,6 +835,7 @@ public abstract class XmppActivity extends Activity {
keyType.setOnLongClickListener(purge);
boolean x509 = Config.X509_VERIFICATION && status.getTrust() == FingerprintStatus.Trust.VERIFIED_X509;
final View.OnClickListener toast;
+ trustToggle.setChecked(status.isTrusted(), false);
if (status.isActive()) {
key.setTextColor(getPrimaryTextColor());
keyType.setTextColor(getSecondaryTextColor());
@@ -844,7 +845,6 @@ public abstract class XmppActivity extends Activity {
trustToggle.setEnabled(false);
} else {
trustToggle.setOnClickListener(null);
- trustToggle.setChecked(status.isTrusted(), false);
trustToggle.setEnabled(true);
}
toast = new View.OnClickListener() {
@@ -858,7 +858,6 @@ public abstract class XmppActivity extends Activity {
keyType.setTextColor(getTertiaryTextColor());
trustToggle.setOnClickListener(null);
trustToggle.setEnabled(false);
- trustToggle.setChecked(status.isTrusted(), false);
toast = new View.OnClickListener() {
@Override
public void onClick(View v) {