Prevent deleting call events with DELETION_TIMESTAMP set to 0.

This commit is contained in:
Alex Hart 2023-04-13 10:27:07 -03:00 committed by Greyson Parrelli
parent 3451ac4504
commit d77555266b

View file

@ -201,10 +201,10 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
.readToSingleLong(0L)
}
fun deleteCallEventsDeletedBefore(threshold: Long) {
writableDatabase
fun deleteCallEventsDeletedBefore(threshold: Long): Int {
return writableDatabase
.delete(TABLE_NAME)
.where("$DELETION_TIMESTAMP <= ?", threshold)
.where("$DELETION_TIMESTAMP > 0 AND $DELETION_TIMESTAMP <= ?", threshold)
.run()
}