diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-01-13 12:19:56 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-01-13 12:19:56 +0100 |
commit | 14428da10835f21d486b746308dfa198b1c87637 (patch) | |
tree | a55478ea9f526c57b2ea9e3f79e35174846f3861 /src/main/java/eu | |
parent | 571eb2f7f92bf4dfaa3611291ef7c96294dfa393 (diff) |
show key fetch error in activity when there are no keys to be used
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index 2e6d32466..bc319108c 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -42,6 +42,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate private Button mSaveButton; private Button mCancelButton; + private AxolotlService.FetchStatus lastFetchReport = AxolotlService.FetchStatus.SUCCESS; + private final Map<String, Boolean> ownKeysToTrust = new HashMap<>(); private final Map<String, Boolean> foreignKeysToTrust = new HashMap<>(); @@ -160,7 +162,11 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate } else { if (!hasForeignKeys && hasNoOtherTrustedKeys()) { keyErrorMessageCard.setVisibility(View.VISIBLE); - keyErrorMessage.setText(R.string.error_no_keys_to_trust); + if (lastFetchReport == AxolotlService.FetchStatus.ERROR) { + keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error); + } else { + keyErrorMessage.setText(R.string.error_no_keys_to_trust); + } ownKeys.removeAllViews(); ownKeysCard.setVisibility(View.GONE); foreignKeys.removeAllViews(); foreignKeysCard.setVisibility(View.GONE); } @@ -216,6 +222,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate @Override public void onKeyStatusUpdated(final AxolotlService.FetchStatus report) { if (report != null) { + lastFetchReport = report; runOnUiThread(new Runnable() { @Override public void run() { |