Merge remote-tracking branch 'origin/dev' into closed_groups

# Conflicts:
#	app/src/main/java/org/thoughtcrime/securesms/database/ConfigDatabase.kt
This commit is contained in:
SessionHero01 2024-10-14 14:37:46 +11:00
commit 007fda6bae
No known key found for this signature in database

View File

@ -102,10 +102,14 @@ class ConfigDatabase(context: Context, helper: SQLCipherOpenHelper): Database(co
} }
fun retrieveConfigLastUpdateTimestamp(variant: ConfigVariant, publicKey: String): Long { fun retrieveConfigLastUpdateTimestamp(variant: ConfigVariant, publicKey: String): Long {
val db = readableDatabase return readableDatabase
val cursor = db.query(TABLE_NAME, arrayOf(TIMESTAMP), VARIANT_AND_PUBKEY_WHERE, arrayOf(variant, publicKey),null, null, null) .query(TABLE_NAME, arrayOf(TIMESTAMP), VARIANT_AND_PUBKEY_WHERE, arrayOf(variant, publicKey), null, null, null)
if (cursor == null) return 0 ?.use { cursor ->
if (!cursor.moveToFirst()) return 0 if (cursor.moveToFirst()) {
return (cursor.getLongOrNull(cursor.getColumnIndex(TIMESTAMP)) ?: 0) cursor.getLongOrNull(cursor.getColumnIndex(TIMESTAMP))
} else {
null
}
} ?: 0L
} }
} }