Add call log event proto updates.

This commit is contained in:
Alex Hart
2024-03-15 11:38:16 -03:00
committed by Cody Henthorne
parent 989bd662c6
commit 6f46331772
6 changed files with 48 additions and 17 deletions

View File

@@ -947,12 +947,12 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
/**
* Gets the most recent timestamp from the [TIMESTAMP] column
*/
fun getLatestTimestamp(): Long {
fun getLatestCall(): Call? {
val statement = """
SELECT $TIMESTAMP FROM $TABLE_NAME ORDER BY $TIMESTAMP DESC LIMIT 1
SELECT * FROM $TABLE_NAME ORDER BY $TIMESTAMP DESC LIMIT 1
""".trimIndent()
return readableDatabase.query(statement).readToSingleLong(-1)
return readableDatabase.query(statement).readToSingleObject { Call.deserialize(it) }
}
fun deleteNonAdHocCallEventsOnOrBefore(timestamp: Long) {