fix: prevent message request response from being deleted by any config

This commit is contained in:
0x330a 2023-08-09 10:59:57 +10:00
parent 2e3d50364c
commit 9dc8f18b86
2 changed files with 2 additions and 9 deletions

View File

@ -629,7 +629,6 @@ public class SmsDatabase extends MessagingDatabase {
long threadId = getThreadIdForMessage(messageId); long threadId = getThreadIdForMessage(messageId);
db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""}); db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""});
boolean threadDeleted = DatabaseComponent.get(context).threadDatabase().update(threadId, false, true); boolean threadDeleted = DatabaseComponent.get(context).threadDatabase().update(threadId, false, true);
notifyConversationListeners(threadId);
return threadDeleted; return threadDeleted;
} }

View File

@ -1512,18 +1512,12 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
} }
recipientDb.setApproved(sender, true) recipientDb.setApproved(sender, true)
recipientDb.setApprovedMe(sender, true) recipientDb.setApprovedMe(sender, true)
val expirationConfig = getExpirationConfiguration(threadId)
val expiryMode = expirationConfig?.expiryMode
val expiresInMillis = (expiryMode?.expirySeconds ?: 0) * 1000L
val expireStartedAt = if (expiryMode is ExpiryMode.AfterSend) {
response.sentTimestamp!!
} else 0
val message = IncomingMediaMessage( val message = IncomingMediaMessage(
sender.address, sender.address,
response.sentTimestamp!!, response.sentTimestamp!!,
-1, -1,
expiresInMillis, 0,
expireStartedAt, 0,
false, false,
false, false,
true, true,