show fetch errors in trust keys activity
This commit is contained in:
parent
ba98fe4f86
commit
43521891f0
|
@ -79,6 +79,19 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean fetchMapHasErrors(Contact contact) {
|
||||
Jid jid = contact.getJid().toBareJid();
|
||||
if (deviceIds.get(jid) != null) {
|
||||
for (Integer foreignId : this.deviceIds.get(jid)) {
|
||||
AxolotlAddress address = new AxolotlAddress(jid.toString(), foreignId);
|
||||
if (fetchStatusMap.getAll(address).containsValue(FetchStatus.ERROR)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class AxolotlAddressMap<T> {
|
||||
protected Map<String, Map<Integer, T>> map;
|
||||
protected final Object MAP_LOCK = new Object();
|
||||
|
|
|
@ -162,7 +162,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
|
|||
} else {
|
||||
if (!hasForeignKeys && hasNoOtherTrustedKeys()) {
|
||||
keyErrorMessageCard.setVisibility(View.VISIBLE);
|
||||
if (lastFetchReport == AxolotlService.FetchStatus.ERROR) {
|
||||
if (lastFetchReport == AxolotlService.FetchStatus.ERROR
|
||||
|| contact.getAccount().getAxolotlService().fetchMapHasErrors(contact)) {
|
||||
keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error);
|
||||
} else {
|
||||
keyErrorMessage.setText(R.string.error_no_keys_to_trust);
|
||||
|
|
Loading…
Reference in a new issue