mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 18:57:43 +00:00
Clean
This commit is contained in:
parent
48f19a80b3
commit
063e0967df
@ -3,22 +3,22 @@ package org.thoughtcrime.securesms.loki
|
||||
import android.content.Context
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.whispersystems.libsignal.state.PreKeyBundle
|
||||
import org.whispersystems.signalservice.loki.messaging.LokiPreKeyBundleStore
|
||||
import org.whispersystems.signalservice.loki.messaging.LokiPreKeyBundleStoreProtocol
|
||||
|
||||
class LokiPreKeyBundleStore(val context: Context) : LokiPreKeyBundleStoreProtocol {
|
||||
|
||||
companion object {
|
||||
val FILE_LOCK = Object()
|
||||
private val fileLock = Object()
|
||||
}
|
||||
|
||||
override fun getPreKeyBundle(pubKey: String): PreKeyBundle? {
|
||||
synchronized (FILE_LOCK) {
|
||||
synchronized (fileLock) {
|
||||
return DatabaseFactory.getLokiPreKeyBundleDatabase(context).getPreKeyBundle(pubKey)
|
||||
}
|
||||
}
|
||||
|
||||
override fun removePreKeyBundle(pubKey: String) {
|
||||
synchronized (FILE_LOCK) {
|
||||
synchronized (fileLock) {
|
||||
DatabaseFactory.getLokiPreKeyBundleDatabase(context).removePreKeyBundle(pubKey)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user