From 2e8e428257c5135c80db6378b0aac7ab2acbe447 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 12 Jun 2020 15:15:33 +1000 Subject: [PATCH] Don't repair session if there's an outstanding session request --- .../thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt b/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt index be4a3d580b..5f953a4b7b 100644 --- a/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt @@ -323,14 +323,14 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( database.insertOrUpdate(userCountCache, row, "$publicChatID = ?", wrap(index)) } - fun getSessionRequestTimestamp(publicKey: String): Long? { + override fun getSessionRequestTimestamp(publicKey: String): Long? { val database = databaseHelper.readableDatabase return database.get(sessionRequestTimestampCache, "$LokiAPIDatabase.publicKey = ?", wrap(publicKey)) { cursor -> cursor.getInt(LokiAPIDatabase.timestamp) }?.toLong() } - fun setSessionRequestTimestamp(publicKey: String, timestamp: Long) { + override fun setSessionRequestTimestamp(publicKey: String, timestamp: Long) { val database = databaseHelper.writableDatabase val row = wrap(mapOf(LokiAPIDatabase.publicKey to publicKey, LokiAPIDatabase.timestamp to timestamp.toString())) database.insertOrUpdate(sessionRequestTimestampCache, row, "${LokiAPIDatabase.publicKey} = ?", wrap(publicKey))