aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-08 10:14:12 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-08 10:14:12 +0200
commit0d8bf660db579c863459d2409175d9d9d8baacf0 (patch)
tree36f40aaec1a3a50492f9d36eb2ec6dd7ec5e46cc /src/eu/siacs/conversations/ui
parentf4330b3a4818b70193f378be382075c5c1a7bf9e (diff)
fixed download button on pgp images
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index ebfeb8a3..2a6cc886 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -273,9 +273,7 @@ public class ConversationFragment extends Fragment {
String filesize = "";
- if ((item.getType() == Message.TYPE_IMAGE)
- && ((item.getEncryption() == Message.ENCRYPTION_DECRYPTED) || (item
- .getEncryption() == Message.ENCRYPTION_NONE))) {
+ if (item.getType() == Message.TYPE_IMAGE) {
String[] fileParams = item.getBody().split(",");
if ((fileParams.length >= 1)
&& (item.getStatus() != Message.STATUS_PREPARING)) {
@@ -316,7 +314,8 @@ public class ConversationFragment extends Fragment {
}
}
});
- } else {
+ } else if ((item.getEncryption() == Message.ENCRYPTION_DECRYPTED)
+ || (item.getEncryption() == Message.ENCRYPTION_NONE)) {
viewHolder.messageBody.setVisibility(View.GONE);
viewHolder.image.setVisibility(View.VISIBLE);
if (fileParams.length == 3) {
@@ -357,6 +356,22 @@ public class ConversationFragment extends Fragment {
startActivity(intent);
}
});
+ } else if (item.getEncryption() == Message.ENCRYPTION_PGP) {
+ viewHolder.image.setVisibility(View.GONE);
+ viewHolder.messageBody.setVisibility(View.VISIBLE);
+ viewHolder.messageBody
+ .setText(getString(R.string.encrypted_message));
+ viewHolder.messageBody.setTextColor(0xff33B5E5);
+ viewHolder.messageBody.setTypeface(null,
+ Typeface.ITALIC);
+ } else {
+ viewHolder.image.setVisibility(View.GONE);
+ viewHolder.messageBody.setVisibility(View.VISIBLE);
+ viewHolder.messageBody
+ .setText(getString(R.string.decryption_failed));
+ viewHolder.messageBody.setTextColor(0xFFe92727);
+ viewHolder.messageBody.setTypeface(null,
+ Typeface.NORMAL);
}
} else {
viewHolder.image.setVisibility(View.GONE);