aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-17 22:14:49 +0100
committerlookshe <github@lookshe.org>2016-03-17 22:14:49 +0100
commitcb55d2af52c1007b577b1bb1f94a4206aec58ef0 (patch)
tree1fb23a1937d38100876d1eb69c4d5566f394ec1a /src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java
parent0de9c2aa23990749360ee0e9f509e13a54b14137 (diff)
completely implements FS#161
save state of treatAsDownloadable() and set on error to specified value
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java
index e700d6e9..e35c0f97 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java
@@ -561,8 +561,16 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|| (t != null && t instanceof HttpDownloadConnection)) {
copyUrl.setVisible(true);
}
+ boolean b1 = true;
+ b1 &= m.getType() == Message.TYPE_TEXT;
+ b1 &= t == null;
+ b1 &= m.treatAsDownloadable() != Message.Decision.NEVER;
+ boolean b2 = true;
+ b2 &= m.isFileOrImage();
+ b2 &= t instanceof TransferablePlaceholder;
+ b2 &= m.hasFileOnRemoteHost();
if ((m.getType() == Message.TYPE_TEXT && t == null && m.treatAsDownloadable() != Message.Decision.NEVER)
- || (m.isFileOrImage() && t instanceof TransferablePlaceholder && m.hasFileOnRemoteHost())){
+ || (t instanceof TransferablePlaceholder && m.hasFileOnRemoteHost())){
downloadFile.setVisible(true);
downloadFile.setTitle(activity.getString(R.string.download_x_file,UIHelper.getFileDescriptionString(activity, m)));
}