Code review fixes.

This commit is contained in:
Onuray Sahin 2021-02-08 17:26:09 +03:00 committed by Benoit Marty
parent a623395585
commit 8b39eabc0f
4 changed files with 11 additions and 11 deletions

View file

@ -1298,14 +1298,14 @@ internal class DefaultCryptoService @Inject constructor(
}
override fun ensureOutboundSession(roomId: String) {
// Ensure to load all room members
loadRoomMembersTask
.configureWith(LoadRoomMembersTask.Params(roomId)) {
this.callback = NoOpMatrixCallback()
}
.executeBy(taskExecutor)
cryptoCoroutineScope.launch(coroutineDispatchers.crypto) {
// Ensure to load all room members
loadRoomMembersTask
.configureWith(LoadRoomMembersTask.Params(roomId)) {
this.callback = NoOpMatrixCallback()
}
.executeBy(taskExecutor)
val userIds = getRoomUserIds(roomId)
val alg = roomEncryptorsStore.get(roomId)
?: getEncryptionAlgorithm(roomId)

View file

@ -136,7 +136,7 @@ android {
buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\""
resValue "string", "build_number", "\"${buildNumber}\""
buildConfigField "org.matrix.android.sdk.api.crypto.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "org.matrix.android.sdk.api.crypto.OutboundSessionKeySharingStrategy.WhenTyping"
buildConfigField "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy.WhenTyping"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.matrix.android.sdk.api.crypto
package im.vector.app.features.crypto.keysrequest
enum class OutboundSessionKeySharingStrategy {
/**

View file

@ -61,7 +61,7 @@ import org.commonmark.renderer.html.HtmlRenderer
import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.MatrixPatterns
import org.matrix.android.sdk.api.NoOpMatrixCallback
import org.matrix.android.sdk.api.crypto.OutboundSessionKeySharingStrategy
import im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.raw.RawService
@ -599,7 +599,7 @@ class RoomDetailViewModel @AssistedInject constructor(
}
}
// Ensure outbound session keys
if (room.isEncrypted() && BuildConfig.outboundSessionKeySharingStrategy == OutboundSessionKeySharingStrategy.WhenTyping) {
if (action.isTyping && room.isEncrypted() && BuildConfig.outboundSessionKeySharingStrategy == OutboundSessionKeySharingStrategy.WhenTyping) {
room.ensureOutboundSession()
}
}