From 45d68c200e8573abf43a6584d045baf4fcafd196 Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Sat, 15 Aug 2015 18:52:47 +0200 Subject: [PATCH 1/2] Display error message if all contact keys purged --- .../conversations/ui/TrustKeysActivity.java | 10 ++++++ src/main/res/layout/activity_trust_keys.xml | 32 +++++++++++++++++++ src/main/res/values/strings.xml | 2 ++ 3 files changed, 44 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index cf22416fb..0e685c3ee 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -32,6 +32,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate private boolean hasNoTrustedKeys = true; private Contact contact; + private TextView keyErrorMessage; + private LinearLayout keyErrorMessageCard; private TextView ownKeysTitle; private LinearLayout ownKeys; private LinearLayout ownKeysCard; @@ -92,6 +94,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate } hasNoTrustedKeys = getIntent().getBooleanExtra("has_no_trusted", false); + keyErrorMessageCard = (LinearLayout) findViewById(R.id.key_error_message_card); + keyErrorMessage = (TextView) findViewById(R.id.key_error_message); ownKeysTitle = (TextView) findViewById(R.id.own_keys_title); ownKeys = (LinearLayout) findViewById(R.id.own_keys_details); ownKeysCard = (LinearLayout) findViewById(R.id.own_keys_card); @@ -157,6 +161,12 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate setFetching(); lock(); } else { + if (!hasForeignKeys && !hasOtherTrustedKeys) { + keyErrorMessageCard.setVisibility(View.VISIBLE); + keyErrorMessage.setText(R.string.error_no_keys_to_trust); + ownKeys.removeAllViews(); ownKeysCard.setVisibility(View.GONE); + foreignKeys.removeAllViews(); foreignKeysCard.setVisibility(View.GONE); + } lockOrUnlockAsNeeded(); setDone(); } diff --git a/src/main/res/layout/activity_trust_keys.xml b/src/main/res/layout/activity_trust_keys.xml index c535d51df..6f8a1bc9c 100644 --- a/src/main/res/layout/activity_trust_keys.xml +++ b/src/main/res/layout/activity_trust_keys.xml @@ -15,6 +15,38 @@ android:layout_height="wrap_content" android:orientation="vertical"> + + + + + + + + Purge key Are you sure you want to purge this key? It will irreversibly be considered compromised, and you can never build a session with it again. + 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 No more history on server Updating… From 6aec49f06d3d6be9695a4f4f958f201880d09abc Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Sat, 15 Aug 2015 19:07:55 +0200 Subject: [PATCH 2/2] Update license string with libraries --- src/main/res/values/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 417c1a443..2a03847df 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -306,6 +306,10 @@ \n\nhttps://github.com/zxing/zxing\n(Apache License, Version 2.0) \n\nhttps://github.com/google/material-design-icons\n(CC BY 4.0) \n\nhttps://github.com/timroes/EnhancedListView\n(Apache License, Version 2.0) + \n\nhttps://github.com/leolin310148/ShortcutBadger\n(Apache License, Version 2.0) + \n\nhttps://github.com/kyleduo/SwitchButton\n(Apache License, Version 2.0) + \n\nhttps://github.com/WhisperSystems/libaxolotl-java\n(GPLv3) + \n\nhttps://github.com/vinc3m1/RoundedImageView\n(Apache License, Version 2.0) Quiet Hours Start time