mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Fix / clear unknown session map before re-request decrypt
This commit is contained in:
parent
7096094224
commit
ee27d3e047
2 changed files with 8 additions and 3 deletions
|
@ -38,12 +38,16 @@ internal class TimelineEventDecryptor(
|
|||
private val newSessionListener = object : NewSessionListener {
|
||||
override fun onNewSession(roomId: String?, senderKey: String, sessionId: String) {
|
||||
synchronized(unknownSessionsFailure) {
|
||||
val toDecryptAgain = ArrayList<String>()
|
||||
unknownSessionsFailure[sessionId]?.let { eventIds ->
|
||||
eventIds.forEach {
|
||||
toDecryptAgain.addAll(eventIds)
|
||||
}
|
||||
if (toDecryptAgain.isNotEmpty()) {
|
||||
unknownSessionsFailure[sessionId]?.clear()
|
||||
toDecryptAgain.forEach {
|
||||
requestDecryption(it)
|
||||
}
|
||||
}
|
||||
unknownSessionsFailure[sessionId]?.clear()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ class EncryptedItemFactory @Inject constructor(private val messageInformationDat
|
|||
cryptoError?.name
|
||||
}
|
||||
|
||||
val message = stringProvider.getString(R.string.notice_crypto_unable_to_decrypt, errorDescription)
|
||||
val message = stringProvider.getString(R.string.encrypted_message).takeIf { cryptoError == null }
|
||||
?: stringProvider.getString(R.string.notice_crypto_unable_to_decrypt, errorDescription)
|
||||
val spannableStr = span(message) {
|
||||
textStyle = "italic"
|
||||
textColor = colorProvider.getColorFromAttribute(R.attr.riotx_text_secondary)
|
||||
|
|
Loading…
Reference in a new issue