From 187825d6c680d259633d99c3d9a5da6450a8d37f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 6 Oct 2016 22:06:09 +0200 Subject: warn user if account is offline during avatar publication --- .../conversations/ui/PublishProfilePictureActivity.java | 14 ++++++++++---- src/main/res/values/strings.xml | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index f18013c4..9a699b51 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -250,8 +250,11 @@ public class PublishProfilePictureActivity extends XmppActivity { if (!support) { this.hintOrWarning .setTextColor(getWarningTextColor()); - this.hintOrWarning - .setText(R.string.error_publish_avatar_no_server_support); + if (account.getStatus() == Account.State.ONLINE) { + this.hintOrWarning.setText(R.string.error_publish_avatar_no_server_support); + } else { + this.hintOrWarning.setText(R.string.error_publish_avatar_offline); + } } } else { this.avatarUri = this.defaultUri; @@ -306,8 +309,11 @@ public class PublishProfilePictureActivity extends XmppActivity { } else { disablePublishButton(); this.hintOrWarning.setTextColor(getWarningTextColor()); - this.hintOrWarning - .setText(R.string.error_publish_avatar_no_server_support); + if (account.getStatus() == Account.State.ONLINE) { + this.hintOrWarning.setText(R.string.error_publish_avatar_no_server_support); + } else { + this.hintOrWarning.setText(R.string.error_publish_avatar_offline); + } } if (this.defaultUri != null && uri.equals(this.defaultUri)) { this.secondaryHint.setVisibility(View.INVISIBLE); diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 79da0a2f..c7c791df 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -692,4 +692,5 @@ Delete OMEMO identities Regenerate your OMEMO keys. All your contacts will have to verify you again. Use this only as a last resort. Delete selected keys + You need to be connected to publish your avatar. -- cgit v1.2.3