forked from GitHub-Mirror/riotX-android
Fix / clear unknown session map before re-request decrypt
This commit is contained in:
parent
7096094224
commit
ee27d3e047
@ -38,12 +38,16 @@ internal class TimelineEventDecryptor(
|
|||||||
private val newSessionListener = object : NewSessionListener {
|
private val newSessionListener = object : NewSessionListener {
|
||||||
override fun onNewSession(roomId: String?, senderKey: String, sessionId: String) {
|
override fun onNewSession(roomId: String?, senderKey: String, sessionId: String) {
|
||||||
synchronized(unknownSessionsFailure) {
|
synchronized(unknownSessionsFailure) {
|
||||||
|
val toDecryptAgain = ArrayList<String>()
|
||||||
unknownSessionsFailure[sessionId]?.let { eventIds ->
|
unknownSessionsFailure[sessionId]?.let { eventIds ->
|
||||||
eventIds.forEach {
|
toDecryptAgain.addAll(eventIds)
|
||||||
|
}
|
||||||
|
if (toDecryptAgain.isNotEmpty()) {
|
||||||
|
unknownSessionsFailure[sessionId]?.clear()
|
||||||
|
toDecryptAgain.forEach {
|
||||||
requestDecryption(it)
|
requestDecryption(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unknownSessionsFailure[sessionId]?.clear()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,8 @@ class EncryptedItemFactory @Inject constructor(private val messageInformationDat
|
|||||||
cryptoError?.name
|
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) {
|
val spannableStr = span(message) {
|
||||||
textStyle = "italic"
|
textStyle = "italic"
|
||||||
textColor = colorProvider.getColorFromAttribute(R.attr.riotx_text_secondary)
|
textColor = colorProvider.getColorFromAttribute(R.attr.riotx_text_secondary)
|
||||||
|
Loading…
Reference in New Issue
Block a user