Convert RetrieveProfileJob to kotlin.

This commit is contained in:
Greyson Parrelli
2023-12-20 13:58:34 -05:00
committed by Clark Chen
parent ca9a629804
commit f10418face
4 changed files with 591 additions and 678 deletions

View File

@@ -3473,19 +3473,12 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
fun markProfilesFetched(ids: Collection<RecipientId>, time: Long) {
val db = writableDatabase
db.beginTransaction()
try {
val values = ContentValues(1).apply {
put(LAST_PROFILE_FETCH, time)
}
writableDatabase.withinTransaction { db ->
val values = contentValuesOf(LAST_PROFILE_FETCH to time)
for (id in ids) {
db.update(TABLE_NAME, values, ID_WHERE, arrayOf(id.serialize()))
SqlUtil.buildCollectionQuery(ID, ids).forEach { query ->
db.update(TABLE_NAME, values, query.where, query.whereArgs)
}
db.setTransactionSuccessful()
} finally {
db.endTransaction()
}
}