diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/signout/SignOutService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/signout/SignOutService.kt index 2c2e0f0d61..8929fec283 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/signout/SignOutService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/signout/SignOutService.kt @@ -29,7 +29,6 @@ interface SignOutService { * The same deviceId will be used */ fun signInAgain(password: String, - deviceName: String, callback: MatrixCallback): Cancelable /** diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/DefaultSignOutService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/DefaultSignOutService.kt index a992e67dec..fdbb102cee 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/DefaultSignOutService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/DefaultSignOutService.kt @@ -28,10 +28,9 @@ internal class DefaultSignOutService @Inject constructor(private val signOutTask private val taskExecutor: TaskExecutor) : SignOutService { override fun signInAgain(password: String, - deviceName: String, callback: MatrixCallback): Cancelable { return signInAgainTask - .configureWith(SignInAgainTask.Params(password, deviceName)) { + .configureWith(SignInAgainTask.Params(password)) { this.callback = callback } .executeBy(taskExecutor) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/SignInAgainTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/SignInAgainTask.kt index 2bdac6664f..463e9079b3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/SignInAgainTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/signout/SignInAgainTask.kt @@ -26,8 +26,7 @@ import javax.inject.Inject internal interface SignInAgainTask : Task { data class Params( - val password: String, - val deviceName: String + val password: String ) } @@ -43,9 +42,11 @@ internal class DefaultSignInAgainTask @Inject constructor( // Reuse the same userId sessionParams.credentials.userId, params.password, - params.deviceName, + // The spec says it will be ignored + // https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-login + // but https://github.com/matrix-org/synapse/issues/6525 // Reuse the same deviceId - sessionParams.credentials.deviceId + deviceId = sessionParams.credentials.deviceId ) ) } diff --git a/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewModel.kt b/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewModel.kt index ed23f4660a..8f6128093a 100644 --- a/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewModel.kt @@ -22,11 +22,9 @@ import com.squareup.inject.assisted.AssistedInject import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.session.Session import im.vector.matrix.android.api.util.Cancelable -import im.vector.riotx.R import im.vector.riotx.core.di.ActiveSessionHolder import im.vector.riotx.core.extensions.toReducedUrl import im.vector.riotx.core.platform.VectorViewModel -import im.vector.riotx.core.resources.StringProvider /** * @@ -34,7 +32,6 @@ import im.vector.riotx.core.resources.StringProvider class SoftLogoutViewModel @AssistedInject constructor( @Assisted initialState: SoftLogoutViewState, private val session: Session, - private val stringProvider: StringProvider, private val activeSessionHolder: ActiveSessionHolder) : VectorViewModel(initialState) { @@ -77,8 +74,6 @@ class SoftLogoutViewModel @AssistedInject constructor( private fun handleSignInAgain(action: SoftLogoutAction.SignInAgain) { setState { copy(asyncLoginAction = Loading()) } currentTask = session.signInAgain(action.password, - // TODO We should use the previous device name (we have to provide it for the homeserver - stringProvider.getString(R.string.login_mobile_device), object : MatrixCallback { override fun onFailure(failure: Throwable) { setState {