Don't delete old call messages on new call message

This commit is contained in:
Andrew 2024-02-06 10:44:17 +10:30
parent f3bb2e5cfa
commit ace7e3b54c

View File

@ -448,9 +448,7 @@ public class SmsDatabase extends MessagingDatabase {
CallMessageType callMessageType = message.getCallType();
if (callMessageType != null) {
long callMessageTypeMask = getCallMessageTypeMask(callMessageType);
type |= callMessageTypeMask;
deleteInfoMessages(threadId, callMessageTypeMask);
type |= getCallMessageTypeMask(callMessageType);
}
ContentValues values = new ContentValues(6);
@ -683,12 +681,6 @@ public class SmsDatabase extends MessagingDatabase {
return getMessage(messageId);
}
public void deleteInfoMessages(long threadId, long type) {
String where = THREAD_ID + " = ? AND (" + TYPE + " & " + type + ") <> 0";
int updated = getWritableDatabase().delete(TABLE_NAME, where, new String[] {threadId+""});
notifyConversationListeners(threadId);
}
private boolean isDuplicate(IncomingTextMessage message, long threadId) {
SQLiteDatabase database = databaseHelper.getReadableDatabase();
Cursor cursor = database.query(TABLE_NAME, null, DATE_SENT + " = ? AND " + ADDRESS + " = ? AND " + THREAD_ID + " = ?",