mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 03:48:12 +03:00
post merge code quality
This commit is contained in:
parent
ce86e29122
commit
8132a7902b
7 changed files with 14 additions and 6 deletions
|
@ -855,10 +855,12 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
* Handle a key event.
|
||||
*
|
||||
* @param event the key event.
|
||||
* @param acceptUnrequested, if true it will force to accept unrequested keys.
|
||||
*/
|
||||
private fun onRoomKeyEvent(event: Event, acceptUnrequested: Boolean = false) {
|
||||
val roomKeyContent = event.getDecryptedContent().toModel<RoomKeyContent>() ?: return
|
||||
Timber.tag(loggerTag.value).i("onRoomKeyEvent(forceAccept:$acceptUnrequested) from: ${event.senderId} type<${event.getClearType()}> , sessionId<${roomKeyContent.sessionId}>")
|
||||
Timber.tag(loggerTag.value)
|
||||
.i("onRoomKeyEvent(f:$acceptUnrequested) from: ${event.senderId} type<${event.getClearType()}> , session<${roomKeyContent.sessionId}>")
|
||||
if (roomKeyContent.roomId.isNullOrEmpty() || roomKeyContent.algorithm.isNullOrEmpty()) {
|
||||
Timber.tag(loggerTag.value).e("onRoomKeyEvent() : missing fields")
|
||||
return
|
||||
|
|
|
@ -603,6 +603,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* @param keysClaimed Other keys the sender claims.
|
||||
* @param exportFormat true if the megolm keys are in export format
|
||||
* @param sharedHistory MSC3061, this key is sharable on invite
|
||||
* @param trusted True if the key is coming from a trusted source
|
||||
* @return true if the operation succeeds.
|
||||
*/
|
||||
fun addInboundGroupSession(
|
||||
|
|
|
@ -41,6 +41,7 @@ internal interface IMXDecrypting {
|
|||
*
|
||||
* @param event the key event.
|
||||
* @param defaultKeysBackupService the keys backup service
|
||||
* @param forceAccept the keys backup service
|
||||
*/
|
||||
fun onRoomKeyEvent(event: Event, defaultKeysBackupService: DefaultKeysBackupService, forceAccept: Boolean = false) {}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,7 @@ internal class MXMegolmDecryption(
|
|||
*
|
||||
* @param event the key event.
|
||||
* @param defaultKeysBackupService the keys backup service
|
||||
* @param forceAccept if true will force to accept the forwarded key
|
||||
*/
|
||||
override fun onRoomKeyEvent(event: Event, defaultKeysBackupService: DefaultKeysBackupService, forceAccept: Boolean) {
|
||||
Timber.tag(loggerTag.value).v("onRoomKeyEvent(${event.getSenderKey()})")
|
||||
|
@ -274,7 +275,8 @@ internal class MXMegolmDecryption(
|
|||
|
||||
if (!shouldAcceptForward) {
|
||||
Timber.tag(loggerTag.value)
|
||||
.w("Ignoring forwarded_room_key device:$eventSenderKey, ownVerified:{$isOwnDevice&&$isDeviceVerified}, fromInitiator:$isFromSessionInitiator")
|
||||
.w("Ignoring forwarded_room_key device:$eventSenderKey, ownVerified:{$isOwnDevice&&$isDeviceVerified}," +
|
||||
" fromInitiator:$isFromSessionInitiator")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.concurrent.Executors
|
|||
import javax.inject.Inject
|
||||
import kotlin.math.abs
|
||||
|
||||
private val INVITE_VALIDITY_TIME_WINDOW_MILLIS = 10 * 60_000
|
||||
private const val INVITE_VALIDITY_TIME_WINDOW_MILLIS = 10 * 60_000
|
||||
|
||||
@SessionScope
|
||||
internal class UnRequestedForwardManager @Inject constructor(
|
||||
|
|
|
@ -53,8 +53,10 @@ class UnRequestedKeysManagerTest {
|
|||
),
|
||||
signatures = mapOf(
|
||||
aliceMxId to mapOf(
|
||||
"ed25519:$device1Id" to "bPOAqM40+QSMgeEzUbYbPSZZccDDMUG00lCNdSXCoaS1gKKBGkSEaHO1OcibISIabjLYzmhp9mgtivz32fbABQ",
|
||||
"ed25519:Ru4ni66dbQ6FZgUoHyyBtmjKecOHMvMSsSBZ2SABtt0" to "owzUsQ4Pvn35uEIc5FdVnXVRPzsVYBV8uJRUSqr4y8r5tp0DvrMArtJukKETgYEAivcZMT1lwNihHIN9xh06DA"
|
||||
"ed25519:$device1Id"
|
||||
to "bPOAqM40+QSMgeEzUbYbPSZZccDDMUG00lCNdSXCoaS1gKKBGkSEaHO1OcibISIabjLYzmhp9mgtivz32fbABQ",
|
||||
"ed25519:Ru4ni66dbQ6FZgUoHyyBtmjKecOHMvMSsSBZ2SABtt0"
|
||||
to "owzUsQ4Pvn35uEIc5FdVnXVRPzsVYBV8uJRUSqr4y8r5tp0DvrMArtJukKETgYEAivcZMT1lwNihHIN9xh06DA"
|
||||
)
|
||||
),
|
||||
unsigned = UnsignedDeviceInfo(deviceDisplayName = "Element Web"),
|
||||
|
|
|
@ -165,7 +165,7 @@ class MessageInformationDataFactory @Inject constructor(
|
|||
E2EDecoration.NONE
|
||||
} else {
|
||||
val sendingDevice = event.root.getSenderKey()
|
||||
?.let { it ->
|
||||
?.let {
|
||||
session.cryptoService().deviceWithIdentityKey(
|
||||
it,
|
||||
event.root.content?.get("algorithm") as? String ?: ""
|
||||
|
|
Loading…
Reference in a new issue