From bf8c81d0beebb49a64170e9542c4fe55aff4e84f Mon Sep 17 00:00:00 2001 From: 12aw Date: Fri, 5 Jan 2024 00:24:45 +0100 Subject: [PATCH] Improve message deletion with compatibility to movim (cherry picked from commit 0e18007ab0b176f8089505aa833672a772bc4c45) --- git/release/output-metadata.json | 12 ++++++------ .../conversations/persistance/DatabaseBackend.java | 10 ++++++---- .../siacs/conversations/ui/ConversationFragment.java | 4 ++-- .../conversations/ui/adapter/MessageAdapter.java | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/git/release/output-metadata.json b/git/release/output-metadata.json index 81f728baf..b0829eebf 100644 --- a/git/release/output-metadata.json +++ b/git/release/output-metadata.json @@ -20,13 +20,13 @@ "filters": [ { "filterType": "ABI", - "value": "x86_64" + "value": "x86" } ], "attributes": [], - "versionCode": 15603, + "versionCode": 15602, "versionName": "1.7.8.5", - "outputFile": "monocles chat-1.7.8.5-git-x86_64-release.apk" + "outputFile": "monocles chat-1.7.8.5-git-x86-release.apk" }, { "type": "ONE_OF_MANY", @@ -46,13 +46,13 @@ "filters": [ { "filterType": "ABI", - "value": "x86" + "value": "x86_64" } ], "attributes": [], - "versionCode": 15602, + "versionCode": 15603, "versionName": "1.7.8.5", - "outputFile": "monocles chat-1.7.8.5-git-x86-release.apk" + "outputFile": "monocles chat-1.7.8.5-git-x86_64-release.apk" }, { "type": "ONE_OF_MANY", diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 97b3edf45..1987ee801 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -1086,25 +1086,27 @@ public class DatabaseBackend extends SQLiteOpenHelper { SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor; if (timestamp == -1) { - String[] selectionArgs = {conversation.getUuid()}; + String[] selectionArgs = {conversation.getUuid(), "1"}; cursor = db.rawQuery( "SELECT * FROM " + Message.TABLENAME + " " + "LEFT JOIN monocles." + Message.TABLENAME + " USING (" + Message.UUID + ")" + - "WHERE " + Message.CONVERSATION + "=? " + + "WHERE " + Message.CONVERSATION + "=? AND " + + Message.DELETED + " { final Transferable transferable = message.getTransferable(); final boolean unInitiatedButKnownSize = MessageUtils.unInitiatedButKnownSize(message); if (unInitiatedButKnownSize || (message.isFileDeleted() && message.getModerated() == null) || (transferable != null && transferable.getStatus() != Transferable.STATUS_UPLOADING)) { - if (unInitiatedButKnownSize || transferable != null && transferable.getStatus() == Transferable.STATUS_OFFER) { + if (unInitiatedButKnownSize || message.isMessageDeleted() || transferable != null && transferable.getStatus() == Transferable.STATUS_OFFER) { displayDownloadableMessage(viewHolder, message, activity.getString(R.string.download_x_file, UIHelper.getFileDescriptionString(activity, message)), darkBackground, type); } 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)), darkBackground, type);