diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index 65194e00..c14e0961 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -228,7 +228,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); } @@ -251,7 +259,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); } @@ -265,6 +277,15 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } } + private boolean anyWithoutMutualPresenceSubscription(List contactJids){ + for(Jid jid : contactJids) { + if (!mAccount.getRoster().getContact(jid).mutualPresenceSubscription()) { + return true; + } + } + return false; + } + private boolean foreignActuallyHasKeys() { synchronized (this.foreignKeysToTrust) { for (Map.Entry> entry : foreignKeysToTrust.entrySet()) { diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 00f18e14..37f2ae96 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -434,6 +434,7 @@ Clear devices Are you sure you want to clear all other devices from the OMEMO announcement? The next time your devices connect, they will reannounce themselves, but they might not receive messages sent in the meantime. There are no usable keys available for this contact.\nFetching new keys from the server has been unsuccessful. Maybe there is something wrong with your contacts server. + There are no usable keys available for this contact.\nMake sure you have mutual presence subscription. There are no usable keys available for this contact. If you have purged any of their keys, they need to generate new ones. Error Fetching history from server