mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 09:48:27 +00:00
Merge pull request #229 from loki-project/closed-groups
Fix Closed Group Session Handling Bug
This commit is contained in:
commit
adf69d0dde
@ -323,14 +323,14 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(
|
|||||||
database.insertOrUpdate(userCountCache, row, "$publicChatID = ?", wrap(index))
|
database.insertOrUpdate(userCountCache, row, "$publicChatID = ?", wrap(index))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSessionRequestTimestamp(publicKey: String): Long? {
|
override fun getSessionRequestTimestamp(publicKey: String): Long? {
|
||||||
val database = databaseHelper.readableDatabase
|
val database = databaseHelper.readableDatabase
|
||||||
return database.get(sessionRequestTimestampCache, "$LokiAPIDatabase.publicKey = ?", wrap(publicKey)) { cursor ->
|
return database.get(sessionRequestTimestampCache, "$LokiAPIDatabase.publicKey = ?", wrap(publicKey)) { cursor ->
|
||||||
cursor.getInt(LokiAPIDatabase.timestamp)
|
cursor.getInt(LokiAPIDatabase.timestamp)
|
||||||
}?.toLong()
|
}?.toLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSessionRequestTimestamp(publicKey: String, timestamp: Long) {
|
override fun setSessionRequestTimestamp(publicKey: String, timestamp: Long) {
|
||||||
val database = databaseHelper.writableDatabase
|
val database = databaseHelper.writableDatabase
|
||||||
val row = wrap(mapOf(LokiAPIDatabase.publicKey to publicKey, LokiAPIDatabase.timestamp to timestamp.toString()))
|
val row = wrap(mapOf(LokiAPIDatabase.publicKey to publicKey, LokiAPIDatabase.timestamp to timestamp.toString()))
|
||||||
database.insertOrUpdate(sessionRequestTimestampCache, row, "${LokiAPIDatabase.publicKey} = ?", wrap(publicKey))
|
database.insertOrUpdate(sessionRequestTimestampCache, row, "${LokiAPIDatabase.publicKey} = ?", wrap(publicKey))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user