aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
index 061bb7b28..8a92a2b35 100644
--- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
@@ -230,7 +230,15 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
}
if (fingerprints.size() == 0) {
informNoKeys.setVisibility(View.VISIBLE);
- informNoKeys.setText(getString(R.string.no_keys_just_confirm, mAccount.getRoster().getContact(jid).getDisplayName()));
+ if (hasNoOtherTrustedKeys(jid)) {
+ if (!mAccount.getRoster().getContact(jid).mutualPresenceSubscription()) {
+ informNoKeys.setText(R.string.error_no_keys_to_trust_presence);
+ } else {
+ informNoKeys.setText(R.string.error_no_keys_to_trust_server_error);
+ }
+ } else {
+ informNoKeys.setText(getString(R.string.no_keys_just_confirm, mAccount.getRoster().getContact(jid).getDisplayName()));
+ }
} else {
informNoKeys.setVisibility(View.GONE);
}
@@ -253,7 +261,11 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
keyErrorMessageCard.setVisibility(View.VISIBLE);
if (lastFetchReport == AxolotlService.FetchStatus.ERROR
|| mAccount.getAxolotlService().fetchMapHasErrors(contactJids)) {
- keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error);
+ if (anyWithoutMutualPresenceSubscription(contactJids)) {
+ keyErrorMessage.setText(R.string.error_no_keys_to_trust_presence);
+ } else {
+ keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error);
+ }
} else {
keyErrorMessage.setText(R.string.error_no_keys_to_trust);
}
@@ -267,6 +279,15 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
}
}
+ private boolean anyWithoutMutualPresenceSubscription(List<Jid> contactJids) {
+ for (Jid jid : contactJids) {
+ if (!mAccount.getRoster().getContact(jid).mutualPresenceSubscription()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private boolean foreignActuallyHasKeys() {
synchronized (this.foreignKeysToTrust) {
for (Map.Entry<Jid, Map<String, Boolean>> entry : foreignKeysToTrust.entrySet()) {