From 4539643f27ce38e7de121655effcae4070e25385 Mon Sep 17 00:00:00 2001 From: hlad Date: Fri, 14 Aug 2015 22:24:05 +0200 Subject: show HTTP upload availability on Edit account screen --- src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/eu/siacs/conversations/ui') diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index b4ed044c9..02b1d8738 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -60,6 +60,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate private TextView mServerInfoCSI; private TextView mServerInfoBlocking; private TextView mServerInfoPep; + private TextView mServerInfoHttpUpload; private TextView mSessionEst; private TextView mOtrFingerprint; private TextView mAxolotlFingerprint; @@ -347,6 +348,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate this.mServerInfoBlocking = (TextView) findViewById(R.id.server_info_blocking); this.mServerInfoSm = (TextView) findViewById(R.id.server_info_sm); this.mServerInfoPep = (TextView) findViewById(R.id.server_info_pep); + this.mServerInfoHttpUpload = (TextView) findViewById(R.id.server_info_http_upload); this.mOtrFingerprint = (TextView) findViewById(R.id.otr_fingerprint); this.mOtrFingerprintBox = (RelativeLayout) findViewById(R.id.otr_fingerprint_box); this.mOtrFingerprintToClipboardButton = (ImageButton) findViewById(R.id.action_copy_to_clipboard); @@ -542,6 +544,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } else { this.mServerInfoPep.setText(R.string.server_info_unavailable); } + if (features.httpUpload()) { + this.mServerInfoHttpUpload.setText(R.string.server_info_available); + } else { + this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable); + } final String otrFingerprint = this.mAccount.getOtrFingerprint(); if (otrFingerprint != null) { this.mOtrFingerprintBox.setVisibility(View.VISIBLE); -- cgit v1.2.3 From 45d68c200e8573abf43a6584d045baf4fcafd196 Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Sat, 15 Aug 2015 18:52:47 +0200 Subject: Display error message if all contact keys purged --- src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/eu/siacs/conversations/ui') 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(); } -- cgit v1.2.3