diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-01-25 21:15:09 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-01-25 21:15:09 +0100 |
commit | afcbc3ccf36a44ebb1ff2b3b471078aa13e2aeb2 (patch) | |
tree | f8743542166c7086c8a57503c0794816911a594b /src/main/java/de/pixart/messenger/ui/adapter | |
parent | f7fe29c66964302af11b2a3996e44da48c1d2990 (diff) |
mark deleted files in database and not query them when querying for media
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java index 3e7bccc75..f2ae272f9 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java @@ -139,7 +139,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationAdapte viewHolder.lastMessage.setTypeface(null, Typeface.NORMAL); viewHolder.sender.setTypeface(null, Typeface.ITALIC); } else { - final boolean fileAvailable = message.getTransferable() == null || message.getTransferable().getStatus() != Transferable.STATUS_DELETED; + final boolean fileAvailable = !message.isDeleted(); final boolean showPreviewText; if (fileAvailable && (message.isFileOrImage() || message.treatAsDownloadable() || message.isGeoUri())) { final int imageResource; diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 1c53f1b5d..04373fb6c 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -962,10 +962,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie }); final Transferable transferable = message.getTransferable(); - if (transferable != null && transferable.getStatus() != Transferable.STATUS_UPLOADING) { - if (transferable.getStatus() == Transferable.STATUS_OFFER) { + if (message.isDeleted() || (transferable != null && transferable.getStatus() != Transferable.STATUS_UPLOADING)) { + if (transferable != null && transferable.getStatus() == Transferable.STATUS_OFFER) { displayDownloadableMessage(viewHolder, message, activity.getString(R.string.download_x_file, UIHelper.getFileDescriptionString(activity, message))); - } else if (transferable.getStatus() == Transferable.STATUS_OFFER_CHECK_FILESIZE) { + } else if (transferable != null && transferable.getStatus() == Transferable.STATUS_OFFER_CHECK_FILESIZE) { displayDownloadableMessage(viewHolder, message, activity.getString(R.string.check_x_filesize, UIHelper.getFileDescriptionString(activity, message))); } else { displayInfoMessage(viewHolder, UIHelper.getMessagePreview(activity, message).first, darkBackground); |