Cleaning
This commit is contained in:
parent
10671a53a4
commit
f843dddc3a
@ -434,9 +434,9 @@ internal class DefaultCryptoService @Inject constructor(
|
|||||||
deviceListManager.refreshOutdatedDeviceLists()
|
deviceListManager.refreshOutdatedDeviceLists()
|
||||||
// The presence of device_unused_fallback_key_types indicates that the server supports fallback keys.
|
// The presence of device_unused_fallback_key_types indicates that the server supports fallback keys.
|
||||||
// If there's no unused signed_curve25519 fallback key we need a new one.
|
// If there's no unused signed_curve25519 fallback key we need a new one.
|
||||||
if (syncResponse.deviceUnusedFallbackKeyTypes != null
|
if (syncResponse.deviceUnusedFallbackKeyTypes != null &&
|
||||||
// Generate a fallback key only if the server does not already have an unused fallback key.
|
// Generate a fallback key only if the server does not already have an unused fallback key.
|
||||||
&& !syncResponse.deviceUnusedFallbackKeyTypes.contains(KEY_SIGNED_CURVE_25519_TYPE)) {
|
!syncResponse.deviceUnusedFallbackKeyTypes.contains(KEY_SIGNED_CURVE_25519_TYPE)) {
|
||||||
oneTimeKeysUploader.setNeedsNewFallback()
|
oneTimeKeysUploader.setNeedsNewFallback()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,6 @@ internal class OneTimeKeysUploader @Inject constructor(
|
|||||||
olmDevice.markKeysAsPublished()
|
olmDevice.markKeysAsPublished()
|
||||||
needNewFallbackKey = false
|
needNewFallbackKey = false
|
||||||
|
|
||||||
|
|
||||||
if (response.hasOneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE)) {
|
if (response.hasOneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE)) {
|
||||||
// Maybe upload other keys
|
// Maybe upload other keys
|
||||||
return keysThisLoop + uploadOTK(response.oneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE), keyLimit)
|
return keysThisLoop + uploadOTK(response.oneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE), keyLimit)
|
||||||
@ -177,7 +176,6 @@ internal class OneTimeKeysUploader @Inject constructor(
|
|||||||
oneTimeJson["signed_curve25519:$key_id"] = k
|
oneTimeJson["signed_curve25519:$key_id"] = k
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val fallbackJson = mutableMapOf<String, Any>()
|
val fallbackJson = mutableMapOf<String, Any>()
|
||||||
if (needNewFallbackKey) {
|
if (needNewFallbackKey) {
|
||||||
val fallbackCurve25519Map = olmDevice.getFallbackKey()?.get(OlmAccount.JSON_KEY_ONE_TIME_KEY).orEmpty()
|
val fallbackCurve25519Map = olmDevice.getFallbackKey()?.get(OlmAccount.JSON_KEY_ONE_TIME_KEY).orEmpty()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user