Rename store API

This commit is contained in:
Benoit Marty 2021-07-22 15:26:11 +02:00
parent be488ae75a
commit 7a7c292b3c
3 changed files with 4 additions and 4 deletions

View File

@ -315,7 +315,7 @@ internal class DefaultCryptoService @Inject constructor(
// Open the store // Open the store
cryptoStore.open() cryptoStore.open()
if (!cryptoStore.getDeviceKeysUploaded()) { if (!cryptoStore.areDeviceKeysUploaded()) {
// Schedule upload of OTK // Schedule upload of OTK
oneTimeKeysUploader.updateOneTimeKeyCount(0) oneTimeKeysUploader.updateOneTimeKeyCount(0)
} }
@ -911,7 +911,7 @@ internal class DefaultCryptoService @Inject constructor(
* Upload my user's device keys. * Upload my user's device keys.
*/ */
private suspend fun uploadDeviceKeys() { private suspend fun uploadDeviceKeys() {
if (cryptoStore.getDeviceKeysUploaded()) { if (cryptoStore.areDeviceKeysUploaded()) {
Timber.d("Keys already uploaded, nothing to do") Timber.d("Keys already uploaded, nothing to do")
return return
} }

View File

@ -475,7 +475,7 @@ internal interface IMXCryptoStore {
fun getGossipingEvents(): List<Event> fun getGossipingEvents(): List<Event>
fun setDeviceKeysUploaded(uploaded: Boolean) fun setDeviceKeysUploaded(uploaded: Boolean)
fun getDeviceKeysUploaded(): Boolean fun areDeviceKeysUploaded(): Boolean
fun tidyUpDataBase() fun tidyUpDataBase()
fun logDbUsageInfo() fun logDbUsageInfo()
} }

View File

@ -937,7 +937,7 @@ internal class RealmCryptoStore @Inject constructor(
} }
} }
override fun getDeviceKeysUploaded(): Boolean { override fun areDeviceKeysUploaded(): Boolean {
return doWithRealm(realmConfiguration) { return doWithRealm(realmConfiguration) {
it.where<CryptoMetadataEntity>().findFirst()?.deviceKeysSentToServer it.where<CryptoMetadataEntity>().findFirst()?.deviceKeysSentToServer
} ?: false } ?: false