Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Sep 26, 2024
1 parent c8ab88b commit 1b813f5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.MatrixError
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupLastVersionResult
Expand All @@ -37,7 +36,6 @@ import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.uia.UiaResult
import org.matrix.android.sdk.internal.auth.registration.handleUIA
import org.matrix.android.sdk.internal.crypto.OlmMachine
import org.matrix.android.sdk.internal.crypto.PerSessionBackupQueryRateLimiter
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.BackupKeysResult
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.CreateKeysBackupVersionBody
Expand All @@ -59,7 +57,6 @@ import org.matrix.android.sdk.internal.crypto.model.rest.KeysUploadBody
import org.matrix.android.sdk.internal.crypto.model.rest.KeysUploadResponse
import org.matrix.android.sdk.internal.crypto.model.rest.RestKeyInfo
import org.matrix.android.sdk.internal.crypto.model.rest.SignatureUploadResponse
import org.matrix.android.sdk.internal.crypto.store.IMXCommonCryptoStore
import org.matrix.android.sdk.internal.crypto.tasks.ClaimOneTimeKeysForUsersDeviceTask
import org.matrix.android.sdk.internal.crypto.tasks.DefaultSendVerificationMessageTask
import org.matrix.android.sdk.internal.crypto.tasks.DownloadKeysForUsersTask
Expand Down Expand Up @@ -103,9 +100,7 @@ internal class RequestSender @Inject constructor(
private val moshi: Moshi,
cryptoCoroutineScope: CoroutineScope,
private val rateLimiter: PerSessionBackupQueryRateLimiter,
private val cryptoStore: IMXCommonCryptoStore,
private val localEchoRepository: LocalEchoRepository,
private val olmMachine: Lazy<OlmMachine>
) {

private val scope = CoroutineScope(
Expand Down Expand Up @@ -264,15 +259,8 @@ internal class RequestSender @Inject constructor(
val requestBody = hashMap["body"] as? Map<*, *>
val roomId = requestBody?.get("room_id") as? String
val sessionId = requestBody?.get("session_id") as? String
val senderKey = requestBody?.get("sender_key") as? String
if (roomId != null && sessionId != null) {
// try to perform a lazy migration from legacy store
val legacy = tryOrNull("Failed to access legacy crypto store") {
cryptoStore.getInboundGroupSession(sessionId, senderKey.orEmpty())
}
if (legacy == null || olmMachine.get().importRoomKey(legacy).isFailure) {
rateLimiter.tryFromBackupIfPossible(sessionId, roomId)
}
rateLimiter.tryFromBackupIfPossible(sessionId, roomId)
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ knit {

// Note: 2 digits max for each value
ext.versionMajor = 2
ext.versionMinor = 13
ext.versionMinor = 14
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
<<<<<<< HEAD
ext.versionPatch = 4
=======
ext.versionPatch = 22
>>>>>>> v1.6.22
ext.versionPatch = 0

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
6 changes: 1 addition & 5 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,7 @@ dependencies {
// WebRTC
withdmvoipImplementation('com.github.tchapgouv:webrtc:124.2.0')
// Jitsi
<<<<<<< HEAD
withvoipApi('org.jitsi.react:jitsi-meet-sdk:8.1.1') {
=======
api('org.jitsi.react:jitsi-meet-sdk:10.2.0') {
>>>>>>> v1.6.22
withvoipApi('org.jitsi.react:jitsi-meet-sdk:10.2.0') {
exclude group: 'com.google.firebase'
exclude group: 'com.google.android.gms'
exclude group: 'com.android.installreferrer'
Expand Down
6 changes: 0 additions & 6 deletions vector/src/main/java/im/vector/app/features/VectorFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ class DefaultVectorFeatures @Inject constructor(
override fun isLocationSharingEnabled() = Config.ENABLE_LOCATION_SHARING
override fun forceUsageOfOpusEncoder(): Boolean = false
override fun isNewAppLayoutFeatureEnabled(): Boolean = true
<<<<<<< HEAD
override fun isQrCodeLoginEnabled(): Boolean = false // TCHAP disable QrCode login for now
override fun isQrCodeLoginForAllServers(): Boolean = false
override fun isReciprocateQrCodeLogin(): Boolean = false
=======
>>>>>>> v1.6.22
override fun isVoiceBroadcastEnabled(): Boolean = true
override fun isUnverifiedSessionsAlertEnabled(): Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,35 +131,9 @@ class OnboardingViewModel @AssistedInject constructor(
}
}

<<<<<<< HEAD
private fun checkQrCodeLoginCapability() {
if (!vectorFeatures.isQrCodeLoginEnabled()) {
setState {
copy(
canLoginWithQrCode = false
)
}
} else if (vectorFeatures.isQrCodeLoginForAllServers()) {
// allow for all servers
setState {
copy(
canLoginWithQrCode = true
)
}
} else {
setState {
copy(
canLoginWithQrCode = selectedHomeserver.isLoginWithQrSupported
)
}
}
}

// TCHAP
private var currentHomeServerConnectionConfig: HomeServerConnectionConfig? = null

=======
>>>>>>> v1.6.22
private val matrixOrgUrl = stringProvider.getString(im.vector.app.config.R.string.matrix_org_server_url).ensureTrailingSlash()
private val defaultHomeserverUrl = mdmService.getData(MdmData.DefaultHomeserverUrl, matrixOrgUrl)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ class OnboardingViewModelTest {

// TCHAP unit test
@Test
<<<<<<< HEAD
fun `given combined login enabled, when handling sign in splash action, then emits Tchap sign in`() = runTest {
val test = viewModel.test()
fakeVectorFeatures.givenCombinedLoginEnabled()
Expand All @@ -210,31 +209,6 @@ class OnboardingViewModelTest {
}

@Test
@Ignore("Tchap: this flow does not exist anymore in Tchap")
fun `given combined login enabled, when handling sign in splash action, then emits OpenCombinedLogin with default homeserver qrCode supported`() = runTest {
val test = viewModel.test()
fakeVectorFeatures.givenCombinedLoginEnabled()
givenCanSuccessfullyUpdateHomeserver(A_DEFAULT_HOMESERVER_URL, DEFAULT_SELECTED_HOMESERVER_STATE_WITH_QR_SUPPORTED)

viewModel.handle(OnboardingAction.SplashAction.OnIAlreadyHaveAnAccount(OnboardingFlow.SignIn))

test
.assertStatesChanges(
initialState,
{ copy(onboardingFlow = OnboardingFlow.SignIn) },
{ copy(isLoading = true) },
{ copy(selectedHomeserver = DEFAULT_SELECTED_HOMESERVER_STATE_WITH_QR_SUPPORTED) },
{ copy(signMode = SignMode.SignIn) },
{ copy(canLoginWithQrCode = true) },
{ copy(isLoading = false) }
)
.assertEvents(OnboardingViewEvents.OpenCombinedLogin)
.finish()
}

@Test
=======
>>>>>>> v1.6.22
fun `given can successfully login in with token, when logging in with token, then emits AccountSignedIn`() = runTest {
val test = viewModel.test()
fakeAuthenticationService.givenLoginWizard(fakeLoginWizard)
Expand Down

0 comments on commit 1b813f5

Please sign in to comment.