1
0
Fork 1

Improve message deletion with compatibility to movim

(cherry picked from commit 0e18007ab0)
This commit is contained in:
12aw 2024-01-05 00:24:45 +01:00
parent e4f1f2a518
commit bf8c81d0be
4 changed files with 15 additions and 13 deletions

View file

@ -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",

View file

@ -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 + "<?" +
"ORDER BY " + Message.TIME_SENT + " DESC " +
"LIMIT " + String.valueOf(limit),
selectionArgs
);
} else {
String[] selectionArgs = {conversation.getUuid(),
Long.toString(timestamp)};
Long.toString(timestamp), "1"};
cursor = db.rawQuery(
"SELECT * FROM " + Message.TABLENAME + " " +
"LEFT JOIN monocles." + Message.TABLENAME +
" USING (" + Message.UUID + ")" +
"WHERE " + Message.CONVERSATION + "=? AND " +
Message.TIME_SENT + "<? " +
Message.TIME_SENT + "<? AND " +
Message.DELETED + "<?" +
"ORDER BY " + Message.TIME_SENT + " DESC " +
"LIMIT " + String.valueOf(limit),
selectionArgs

View file

@ -1975,11 +1975,11 @@ public class ConversationFragment extends XmppFragment
&& relevantForCorrection.isLastCorrectableMessage()
&& m.getConversation() instanceof Conversation) {
correctMessage.setVisible(true);
if (!relevantForCorrection.getBody().equals("") && !relevantForCorrection.getBody().equals(" ")) retractMessage.setVisible(true);
if (!relevantForCorrection.getBody().equals("") && !relevantForCorrection.getBody().equals(" ")) retractMessage.setVisible(false);
}
if (relevantForCorrection.getReactions() != null) {
correctMessage.setVisible(false);
retractMessage.setVisible(true);
retractMessage.setVisible(false);
}
if (conversation.getMode() == Conversation.MODE_MULTI && m.getServerMsgId() != null && m.getModerated() == null && conversation.getMucOptions().getSelf().getRole().ranks(MucOptions.Role.MODERATOR) && conversation.getMucOptions().hasFeature("urn:xmpp:message-moderate:0")) {
moderateMessage.setVisible(true);

View file

@ -1691,7 +1691,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
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);