Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #430 from matrix-org/feature/fix_restore_blocks_ui
Browse files Browse the repository at this point in the history
Fix / Restore backup is blocking UI thread
  • Loading branch information
bmarty committed Feb 18, 2019
2 parents 2a3e326 + a36542f commit d3cd525
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,16 @@ class KeysBackup(private val mCrypto: MXCrypto, session: MXSession) {
return
}

// Compute the recovery key
val privateKey = retrievePrivateKeyWithPassword(password,
megolmBackupAuthData.privateKeySalt!!,
megolmBackupAuthData.privateKeyIterations!!)

val recoveryKey = computeRecoveryKey(privateKey)
mCrypto.decryptingThreadHandler.post {
// Compute the recovery key
val privateKey = retrievePrivateKeyWithPassword(password,
megolmBackupAuthData.privateKeySalt!!,
megolmBackupAuthData.privateKeyIterations!!)

val recoveryKey = computeRecoveryKey(privateKey)
restoreKeysWithRecoveryKey(version, recoveryKey, roomId, sessionId, callback)
}

restoreKeysWithRecoveryKey(version, recoveryKey, roomId, sessionId, callback)
}
})
}
Expand Down

0 comments on commit d3cd525

Please sign in to comment.