post merge

This commit is contained in:
Valere 2020-01-28 12:04:19 +01:00
parent 109ff4f908
commit f021f8110d
9 changed files with 14 additions and 10 deletions

View File

@ -60,7 +60,7 @@ data class VerificationBottomSheetViewState(
class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted initialState: VerificationBottomSheetViewState,
private val session: Session)
: VectorViewModel<VerificationBottomSheetViewState, VerificationAction, EmptyViewEvents>(initialState),
SasVerificationService.SasVerificationListener {
VerificationService.VerificationListener {
// Can be used for several actions, for a one shot result
private val _requestLiveData = MutableLiveData<LiveEvent<Async<VerificationAction>>>()

View File

@ -44,7 +44,7 @@ data class VerificationChooseMethodViewState(
class VerificationChooseMethodViewModel @AssistedInject constructor(
@Assisted initialState: VerificationChooseMethodViewState,
private val session: Session
) : VectorViewModel<VerificationChooseMethodViewState, EmptyAction, EmptyViewEvents>(initialState), SasVerificationService.SasVerificationListener {
) : VectorViewModel<VerificationChooseMethodViewState, EmptyAction, EmptyViewEvents>(initialState), VerificationService.VerificationListener {
override fun transactionCreated(tx: VerificationTransaction) {}

View File

@ -44,7 +44,7 @@ data class VerificationEmojiCodeViewState(
class VerificationEmojiCodeViewModel @AssistedInject constructor(
@Assisted initialState: VerificationEmojiCodeViewState,
private val session: Session
) : VectorViewModel<VerificationEmojiCodeViewState, EmptyAction, EmptyViewEvents>(initialState), SasVerificationService.SasVerificationListener {
) : VectorViewModel<VerificationEmojiCodeViewState, EmptyAction, EmptyViewEvents>(initialState), VerificationService.VerificationListener {
init {
withState { state ->

View File

@ -75,9 +75,9 @@ class RoomMemberProfileController @Inject constructor(
buildProfileSection(stringProvider.getString(R.string.room_profile_section_security))
if (state.isRoomEncrypted) {
if (state.userMXCrossSigningInfo.invoke() != null) {
if (state.userMXCrossSigningInfo != null) {
// Cross signing is enabled for this user
if (state.userMXCrossSigningInfo.invoke()?.isTrusted() == true) {
if (state.userMXCrossSigningInfo.isTrusted()) {
//User is trusted
val icon = if (state.allDevicesAreTrusted.invoke() == true) R.drawable.ic_shield_trusted
else R.drawable.ic_shield_warning

View File

@ -36,6 +36,7 @@ import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.rx.rx
import im.vector.riotx.core.di.HasScreenInjector
import im.vector.riotx.core.platform.EmptyAction
import im.vector.riotx.core.platform.EmptyViewEvents
import im.vector.riotx.core.platform.VectorViewModel
import im.vector.riotx.core.resources.StringProvider
import im.vector.riotx.core.utils.LiveEvent
@ -52,7 +53,8 @@ data class DeviceListViewState(
class DeviceListBottomSheetViewModel @AssistedInject constructor(@Assisted private val initialState: DeviceListViewState,
@Assisted private val userId: String,
private val stringProvider: StringProvider,
private val session: Session) : VectorViewModel<DeviceListViewState, EmptyAction>(initialState) {
private val session: Session)
: VectorViewModel<DeviceListViewState, EmptyAction, EmptyViewEvents>(initialState) {
// Can be used for several actions, for a one shot result
private val _requestLiveData = MutableLiveData<LiveEvent<Async<VerificationAction>>>()

View File

@ -37,6 +37,7 @@ import im.vector.matrix.android.internal.crypto.crosssigning.isVerified
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import im.vector.matrix.android.internal.di.MoshiProvider
import im.vector.matrix.rx.rx
import im.vector.riotx.core.platform.EmptyViewEvents
import im.vector.riotx.core.platform.VectorViewModel
import im.vector.riotx.core.platform.VectorViewModelAction
import im.vector.riotx.core.resources.StringProvider
@ -58,7 +59,7 @@ sealed class CrossSigningAction : VectorViewModelAction {
class CrossSigningSettingsViewModel @AssistedInject constructor(@Assisted private val initialState: CrossSigningSettingsViewState,
private val stringProvider: StringProvider,
private val session: Session)
: VectorViewModel<CrossSigningSettingsViewState, CrossSigningAction>(initialState) {
: VectorViewModel<CrossSigningSettingsViewState, CrossSigningAction, EmptyViewEvents>(initialState) {
// Can be used for several actions, for a one shot result
private val _requestLiveData = MutableLiveData<LiveEvent<Async<CrossSigningAction>>>()

View File

@ -28,6 +28,7 @@ import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.riotx.core.di.HasScreenInjector
import im.vector.riotx.core.platform.EmptyAction
import im.vector.riotx.core.platform.EmptyViewEvents
import im.vector.riotx.core.platform.VectorViewModel
data class DeviceVerificationInfoBottomSheetViewState(
@ -36,7 +37,7 @@ data class DeviceVerificationInfoBottomSheetViewState(
class DeviceVerificationInfoBottomSheetViewModel @AssistedInject constructor(@Assisted initialState: DeviceVerificationInfoBottomSheetViewState,
val session: Session
) : VectorViewModel<DeviceVerificationInfoBottomSheetViewState, EmptyAction>(initialState) {
) : VectorViewModel<DeviceVerificationInfoBottomSheetViewState, EmptyAction, EmptyViewEvents>(initialState) {
@AssistedInject.Factory
interface Factory {

View File

@ -21,7 +21,7 @@ import im.vector.riotx.core.platform.VectorViewModelAction
sealed class DevicesAction : VectorViewModelAction {
object Retry : DevicesAction()
data class Delete(val deviceInfo: DeviceInfo) : DevicesAction()
data class Delete(val deviceId: String) : DevicesAction()
data class Password(val password: String) : DevicesAction()
data class Rename(val deviceInfo: DeviceInfo, val newName: String) : DevicesAction()
data class PromptRename(val deviceId: String, val deviceInfo: DeviceInfo? = null) : DevicesAction()

View File

@ -55,7 +55,7 @@ data class DevicesViewState(
class DevicesViewModel @AssistedInject constructor(@Assisted initialState: DevicesViewState,
private val session: Session)
: VectorViewModel<DevicesViewState, DevicesAction, DevicesViewEvents>(initialState) {
: VectorViewModel<DevicesViewState, DevicesAction, DevicesViewEvents>(initialState), VerificationService.VerificationListener {
@AssistedInject.Factory
interface Factory {