mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Convert RetrieveProfileJob to kotlin.
This commit is contained in:
committed by
Clark Chen
parent
ca9a629804
commit
f10418face
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user