From 2f237cf17b2f2469b61db7700ae7366995c7b33f Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 2 Apr 2020 16:51:40 +0200 Subject: [PATCH] klint --- .../internal/crypto/tasks/RoomVerificationUpdateTask.kt | 1 - .../vector/riotx/core/ui/views/BottomSheetActionButton.kt | 1 - .../crypto/recover/BootstrapAccountPasswordFragment.kt | 3 +-- .../riotx/features/crypto/recover/BootstrapActions.kt | 1 - .../riotx/features/crypto/recover/BootstrapBottomSheet.kt | 2 -- .../features/crypto/recover/BootstrapConclusionFragment.kt | 1 - .../crypto/recover/BootstrapConfirmPassphraseFragment.kt | 1 - .../features/crypto/recover/BootstrapCrossSigningTask.kt | 4 ---- .../crypto/recover/BootstrapEnterPassphraseFragment.kt | 1 - .../crypto/recover/BootstrapSaveRecoveryKeyFragment.kt | 5 +---- .../features/crypto/recover/BootstrapSharedViewModel.kt | 6 ------ .../riotx/features/crypto/recover/BootstrapViewEvents.kt | 1 - .../features/crypto/verification/VerificationBottomSheet.kt | 4 ++-- .../main/java/im/vector/riotx/features/home/HomeActivity.kt | 1 - .../room/detail/timeline/factory/VerificationItemFactory.kt | 1 - 15 files changed, 4 insertions(+), 29 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/RoomVerificationUpdateTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/RoomVerificationUpdateTask.kt index 7a58ecb931..400febc15f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/RoomVerificationUpdateTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/RoomVerificationUpdateTask.kt @@ -35,7 +35,6 @@ import im.vector.matrix.android.internal.di.UserId import im.vector.matrix.android.internal.task.Task import timber.log.Timber import java.util.ArrayList -import java.util.UUID import javax.inject.Inject internal interface RoomVerificationUpdateTask : Task { diff --git a/vector/src/main/java/im/vector/riotx/core/ui/views/BottomSheetActionButton.kt b/vector/src/main/java/im/vector/riotx/core/ui/views/BottomSheetActionButton.kt index 07cb7bb38d..d29982c9e4 100644 --- a/vector/src/main/java/im/vector/riotx/core/ui/views/BottomSheetActionButton.kt +++ b/vector/src/main/java/im/vector/riotx/core/ui/views/BottomSheetActionButton.kt @@ -54,7 +54,6 @@ class BottomSheetActionButton @JvmOverloads constructor( @BindView(R.id.itemVerificationClickableZone) lateinit var clickableView: View - var title: String? = null set(value) { diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapAccountPasswordFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapAccountPasswordFragment.kt index ba9a4e8460..553bff75c4 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapAccountPasswordFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapAccountPasswordFragment.kt @@ -83,7 +83,7 @@ class BootstrapAccountPasswordFragment @Inject constructor( } .disposeOnDestroyView() - withState(sharedViewModel) {state -> + withState(sharedViewModel) { state -> (state.step as? BootstrapStep.AccountPassword)?.failure?.let { bootstrapAccountPasswordTil.error = it } @@ -111,6 +111,5 @@ class BootstrapAccountPasswordFragment @Inject constructor( bootstrapAccountPasswordEditText.showPassword(isPasswordVisible, updateCursor = false) ssss_view_show_password.setImageResource(if (isPasswordVisible) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black) } - } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapActions.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapActions.kt index 6029c526f8..4286c9e571 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapActions.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapActions.kt @@ -29,7 +29,6 @@ sealed class BootstrapActions : VectorViewModelAction { object GoToCompleted : BootstrapActions() object GoToEnterAccountPassword : BootstrapActions() - data class DoInitialize(val passphrase: String, val auth: UserPasswordAuth? = null) : BootstrapActions() object TogglePasswordVisibility : BootstrapActions() data class UpdateCandidatePassphrase(val pass: String) : BootstrapActions() diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapBottomSheet.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapBottomSheet.kt index 8c3086b318..d9ca97a830 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapBottomSheet.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapBottomSheet.kt @@ -28,10 +28,8 @@ import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState -import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth import im.vector.riotx.R import im.vector.riotx.core.di.ScreenComponent -import im.vector.riotx.core.dialogs.PromptPasswordDialog import im.vector.riotx.core.extensions.commitTransaction import im.vector.riotx.core.platform.VectorBaseBottomSheetDialogFragment import kotlinx.android.synthetic.main.bottom_sheet_bootstrap.* diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConclusionFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConclusionFragment.kt index b7b656be74..b04f6951c9 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConclusionFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConclusionFragment.kt @@ -58,6 +58,5 @@ class BootstrapConclusionFragment @Inject constructor( .toSpannable() .colorizeMatchingText(getString(R.string.recovery_passphrase), colorProvider.getColorFromAttribute(android.R.attr.textColorLink)) .colorizeMatchingText(getString(R.string.message_key), colorProvider.getColorFromAttribute(android.R.attr.textColorLink)) - } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt index a7ebd673b6..34a49e852e 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt @@ -120,6 +120,5 @@ class BootstrapConfirmPassphraseFragment @Inject constructor( ssss_passphrase_enter_edittext.showPassword(isPasswordVisible, updateCursor = false) ssss_view_show_password.setImageResource(if (isPasswordVisible) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black) } - } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapCrossSigningTask.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapCrossSigningTask.kt index 09f962dd3f..7c579d8d74 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapCrossSigningTask.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapCrossSigningTask.kt @@ -82,7 +82,6 @@ class BootstrapCrossSigningTask @Inject constructor( } suspend fun execute(params: Params): BootstrapResult { - params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_initializing), isIndeterminate = true)) val crossSigningService = session.cryptoService().crossSigningService() @@ -98,7 +97,6 @@ class BootstrapCrossSigningTask @Inject constructor( val ssssService = session.sharedSecretStorageService - params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_pbkdf2), isIndeterminate = true)) try { keyInfo = awaitCallback { @@ -115,7 +113,6 @@ class BootstrapCrossSigningTask @Inject constructor( return BootstrapResult.FailedToCreateSSSSKey(failure) } - params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_default_key), isIndeterminate = true)) try { awaitCallback { @@ -132,7 +129,6 @@ class BootstrapCrossSigningTask @Inject constructor( val uskPrivateKey = xKeys.user ?: return BootstrapResult.MissingPrivateKey try { - params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_save_msk), isIndeterminate = true)) awaitCallback { ssssService.storeSecret(MASTER_KEY_SSSS_NAME, mskPrivateKey, listOf(SharedSecretStorageService.KeyRef(keyInfo.keyId, keyInfo.keySpec)), it) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt index 3995a7a6dc..35e2e1373c 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt @@ -130,6 +130,5 @@ class BootstrapEnterPassphraseFragment @Inject constructor( } } } - } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt index 186e24a90d..ccd6017613 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt @@ -95,7 +95,6 @@ class BootstrapSaveRecoveryKeyFragment @Inject constructor( requireActivity().toast(R.string.error_no_external_application_found) sharedViewModel.handle(BootstrapActions.SaveReqFailed) } - } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { @@ -127,9 +126,7 @@ class BootstrapSaveRecoveryKeyFragment @Inject constructor( startSharePlainTextIntent(this, context?.getString(R.string.keys_backup_setup_step3_share_intent_chooser_title), recoveryKey, - context?.getString(R.string.recovery_key) - , REQUEST_CODE_COPY) - + context?.getString(R.string.recovery_key), REQUEST_CODE_COPY) } override fun invalidate() = withState(sharedViewModel) { state -> diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSharedViewModel.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSharedViewModel.kt index fcb03c05c1..db714ba2f0 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSharedViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapSharedViewModel.kt @@ -214,12 +214,10 @@ class BootstrapSharedViewModel @AssistedInject constructor( copy(recoverySaveFileProcess = Fail(it)) } }) - } } private fun startInitializeFlow(auth: UserPasswordAuth?) { - setState { copy(step = BootstrapStep.Initializing) } @@ -234,7 +232,6 @@ class BootstrapSharedViewModel @AssistedInject constructor( } } - withState { state -> viewModelScope.launch { bootstrapTask.invoke(this, Params( @@ -277,7 +274,6 @@ class BootstrapSharedViewModel @AssistedInject constructor( if (it is BootstrapResult.GenericError && it.failure is im.vector.matrix.android.api.failure.Failure.OtherServerError && it.failure.httpCode == 401) { - } else { _viewEvents.post(BootstrapViewEvents.ModalError(it.error ?: stringProvider.getString(R.string.matrix_error))) setState { @@ -300,7 +296,6 @@ class BootstrapSharedViewModel @AssistedInject constructor( private fun queryBack() = withState { state -> when (state.step) { is BootstrapStep.SetupPassphrase -> { - } is BootstrapStep.ConfirmPassphrase -> { setState { @@ -311,7 +306,6 @@ class BootstrapSharedViewModel @AssistedInject constructor( ) } } - } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapViewEvents.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapViewEvents.kt index ae6c00d656..524112f8bb 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapViewEvents.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapViewEvents.kt @@ -34,4 +34,3 @@ sealed class BootstrapViewEvents : VectorViewEvents { // val transactionId: String? // ) : DevicesViewEvents() } - diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt index 9097724a35..cd91cc3712 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt @@ -351,11 +351,11 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() { } } -//fun View.getParentCoordinatorLayout(): CoordinatorLayout? { +// fun View.getParentCoordinatorLayout(): CoordinatorLayout? { // var current = this as? View // while (current != null) { // if (current is CoordinatorLayout) return current // current = current.parent as? View // } // return null -//} +// } diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeActivity.kt index 9cdb40e0d9..e286c82532 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeActivity.kt @@ -42,7 +42,6 @@ import im.vector.riotx.core.platform.VectorBaseActivity import im.vector.riotx.core.pushers.PushersManager import im.vector.riotx.features.crypto.recover.BootstrapBottomSheet import im.vector.riotx.features.disclaimer.showDisclaimerDialog -import im.vector.riotx.features.login.LoginAction import im.vector.riotx.features.notifications.NotificationDrawerManager import im.vector.riotx.features.popup.PopupAlertManager import im.vector.riotx.features.popup.VerificationVectorAlert diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt index 419435c579..ee529282f9 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt @@ -23,7 +23,6 @@ import im.vector.matrix.android.api.session.events.model.RelationType import im.vector.matrix.android.api.session.events.model.toModel import im.vector.matrix.android.api.session.room.model.message.MessageRelationContent import im.vector.matrix.android.api.session.room.model.message.MessageVerificationCancelContent -import im.vector.matrix.android.api.session.room.model.message.MessageVerificationRequestContent import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.internal.session.room.VerificationState import im.vector.riotx.core.epoxy.VectorEpoxyModel