crypto: Remove some more unused methods

This commit is contained in:
Damir Jelić 2021-04-01 15:59:36 +02:00
parent dc8711be30
commit ef93d9e625
2 changed files with 0 additions and 45 deletions

View File

@ -68,8 +68,6 @@ interface CryptoService {
fun getUserDevices(userId: String): MutableList<CryptoDeviceInfo>
fun setDevicesKnown(devices: List<MXDeviceInfo>, callback: MatrixCallback<Unit>?)
fun getMyDevice(): CryptoDeviceInfo
fun getGlobalBlacklistUnverifiedDevices(): Boolean
@ -126,8 +124,6 @@ interface CryptoService {
fun getCryptoDeviceInfo(userId: String): List<CryptoDeviceInfo>
fun getLiveCryptoDeviceInfo(): LiveData<List<CryptoDeviceInfo>>
fun getLiveCryptoDeviceInfo(userId: String): LiveData<List<CryptoDeviceInfo>>
fun getLiveCryptoDeviceInfo(userIds: List<String>): LiveData<List<CryptoDeviceInfo>>

View File

@ -413,10 +413,6 @@ internal class DefaultCryptoService @Inject constructor(
return cryptoStore.getUserDeviceList(userId).orEmpty()
}
override fun getLiveCryptoDeviceInfo(): LiveData<List<CryptoDeviceInfo>> {
return cryptoStore.getLiveDeviceList()
}
override fun getLiveCryptoDeviceInfo(userId: String): LiveData<List<CryptoDeviceInfo>> {
return cryptoStore.getLiveDeviceList(userId)
}
@ -425,43 +421,6 @@ internal class DefaultCryptoService @Inject constructor(
return cryptoStore.getLiveDeviceList(userIds)
}
/**
* Set the devices as known
*
* @param devices the devices. Note that the verified member of the devices in this list will not be updated by this method.
* @param callback the asynchronous callback
*/
override fun setDevicesKnown(devices: List<MXDeviceInfo>, callback: MatrixCallback<Unit>?) {
// build a devices map
val devicesIdListByUserId = devices.groupBy({ it.userId }, { it.deviceId })
for ((userId, deviceIds) in devicesIdListByUserId) {
val storedDeviceIDs = cryptoStore.getUserDevices(userId)
// sanity checks
if (null != storedDeviceIDs) {
var isUpdated = false
deviceIds.forEach { deviceId ->
val device = storedDeviceIDs[deviceId]
// assume if the device is either verified or blocked
// it means that the device is known
if (device?.isUnknown == true) {
device.trustLevel = DeviceTrustLevel(crossSigningVerified = false, locallyVerified = false)
isUpdated = true
}
}
if (isUpdated) {
cryptoStore.storeUserDevices(userId, storedDeviceIDs)
}
}
}
callback?.onSuccess(Unit)
}
/**
* Update the blocked/verified state of the given device.
*