Rename handleEvents to handleEvent
This commit is contained in:
parent
6acd0ed687
commit
7ad9c8f687
94 changed files with 182 additions and 182 deletions
|
|
@ -122,7 +122,7 @@ class LoggedInPresenter(
|
||||||
ignoreRegistrationError = ignoreRegistrationError,
|
ignoreRegistrationError = ignoreRegistrationError,
|
||||||
forceNativeSlidingSyncMigration = forceNativeSlidingSyncMigration,
|
forceNativeSlidingSyncMigration = forceNativeSlidingSyncMigration,
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
eventSink = ::handleEvent
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class AnalyticsOptInPresenter(
|
||||||
override fun present(): AnalyticsOptInState {
|
override fun present(): AnalyticsOptInState {
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: AnalyticsOptInEvents) {
|
fun handleEvent(event: AnalyticsOptInEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is AnalyticsOptInEvents.EnableAnalytics -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
is AnalyticsOptInEvents.EnableAnalytics -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
||||||
}
|
}
|
||||||
|
|
@ -39,7 +39,7 @@ class AnalyticsOptInPresenter(
|
||||||
return AnalyticsOptInState(
|
return AnalyticsOptInState(
|
||||||
applicationName = buildMeta.applicationName,
|
applicationName = buildMeta.applicationName,
|
||||||
hasPolicyLink = AnalyticsConfig.POLICY_LINK.isNotEmpty(),
|
hasPolicyLink = AnalyticsConfig.POLICY_LINK.isNotEmpty(),
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class AnalyticsPreferencesPresenter(
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
val isEnabled = analyticsService.userConsentFlow.collectAsState(initial = false)
|
val isEnabled = analyticsService.userConsentFlow.collectAsState(initial = false)
|
||||||
|
|
||||||
fun handleEvents(event: AnalyticsOptInEvents) {
|
fun handleEvent(event: AnalyticsOptInEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is AnalyticsOptInEvents.EnableAnalytics -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
is AnalyticsOptInEvents.EnableAnalytics -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
||||||
}
|
}
|
||||||
|
|
@ -40,7 +40,7 @@ class AnalyticsPreferencesPresenter(
|
||||||
applicationName = buildMeta.applicationName,
|
applicationName = buildMeta.applicationName,
|
||||||
isEnabled = isEnabled.value,
|
isEnabled = isEnabled.value,
|
||||||
policyUrl = AnalyticsConfig.POLICY_LINK,
|
policyUrl = AnalyticsConfig.POLICY_LINK,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class SpaceAnnouncementPresenter(
|
||||||
override fun present(): SpaceAnnouncementState {
|
override fun present(): SpaceAnnouncementState {
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: SpaceAnnouncementEvents) {
|
fun handleEvent(event: SpaceAnnouncementEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SpaceAnnouncementEvents.Continue -> localCoroutineScope.launch {
|
SpaceAnnouncementEvents.Continue -> localCoroutineScope.launch {
|
||||||
announcementStore.setAnnouncementStatus(Announcement.Space, AnnouncementStatus.Shown)
|
announcementStore.setAnnouncementStatus(Announcement.Space, AnnouncementStatus.Shown)
|
||||||
|
|
@ -33,7 +33,7 @@ class SpaceAnnouncementPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
return SpaceAnnouncementState(
|
return SpaceAnnouncementState(
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ class CallScreenPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: CallScreenEvents) {
|
fun handleEvent(event: CallScreenEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is CallScreenEvents.Hangup -> {
|
is CallScreenEvents.Hangup -> {
|
||||||
val widgetId = callWidgetDriver.value?.id
|
val widgetId = callWidgetDriver.value?.id
|
||||||
|
|
@ -201,7 +201,7 @@ class CallScreenPresenter(
|
||||||
userAgent = userAgent,
|
userAgent = userAgent,
|
||||||
isCallActive = isWidgetLoaded,
|
isCallActive = isWidgetLoaded,
|
||||||
isInWidgetMode = isInWidgetMode,
|
isInWidgetMode = isInWidgetMode,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ class ConfigureRoomPresenter(
|
||||||
localCoroutineScope.createRoom(config, createRoomAction)
|
localCoroutineScope.createRoom(config, createRoomAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: ConfigureRoomEvents) {
|
fun handleEvent(event: ConfigureRoomEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is ConfigureRoomEvents.RoomNameChanged -> dataStore.setRoomName(event.name)
|
is ConfigureRoomEvents.RoomNameChanged -> dataStore.setRoomName(event.name)
|
||||||
is ConfigureRoomEvents.TopicChanged -> dataStore.setTopic(event.topic)
|
is ConfigureRoomEvents.TopicChanged -> dataStore.setTopic(event.topic)
|
||||||
|
|
@ -149,7 +149,7 @@ class ConfigureRoomPresenter(
|
||||||
cameraPermissionState = cameraPermissionState,
|
cameraPermissionState = cameraPermissionState,
|
||||||
homeserverName = homeserverName,
|
homeserverName = homeserverName,
|
||||||
roomAddressValidity = roomAddressValidity.value,
|
roomAddressValidity = roomAddressValidity.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class AccountDeactivationPresenter(
|
||||||
|
|
||||||
val formState = remember { mutableStateOf(DeactivateFormState.Default) }
|
val formState = remember { mutableStateOf(DeactivateFormState.Default) }
|
||||||
|
|
||||||
fun handleEvents(event: AccountDeactivationEvents) {
|
fun handleEvent(event: AccountDeactivationEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is AccountDeactivationEvents.SetEraseData -> {
|
is AccountDeactivationEvents.SetEraseData -> {
|
||||||
updateFormState(formState) {
|
updateFormState(formState) {
|
||||||
|
|
@ -63,7 +63,7 @@ class AccountDeactivationPresenter(
|
||||||
return AccountDeactivationState(
|
return AccountDeactivationState(
|
||||||
deactivateFormState = formState.value,
|
deactivateFormState = formState.value,
|
||||||
accountDeactivationAction = action.value,
|
accountDeactivationAction = action.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class ForwardMessagesPresenter(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): ForwardMessagesState {
|
override fun present(): ForwardMessagesState {
|
||||||
fun handleEvents(event: ForwardMessagesEvents) {
|
fun handleEvent(event: ForwardMessagesEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ForwardMessagesEvents.ClearError -> forwardingActionState.value = AsyncAction.Uninitialized
|
ForwardMessagesEvents.ClearError -> forwardingActionState.value = AsyncAction.Uninitialized
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +55,7 @@ class ForwardMessagesPresenter(
|
||||||
|
|
||||||
return ForwardMessagesState(
|
return ForwardMessagesState(
|
||||||
forwardAction = forwardingActionState.value,
|
forwardAction = forwardingActionState.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class NotificationsOptInPresenter(
|
||||||
override fun present(): NotificationsOptInState {
|
override fun present(): NotificationsOptInState {
|
||||||
val notificationsPermissionsState = postNotificationPermissionsPresenter.present()
|
val notificationsPermissionsState = postNotificationPermissionsPresenter.present()
|
||||||
|
|
||||||
fun handleEvents(event: NotificationsOptInEvents) {
|
fun handleEvent(event: NotificationsOptInEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
NotificationsOptInEvents.ContinueClicked -> {
|
NotificationsOptInEvents.ContinueClicked -> {
|
||||||
if (notificationsPermissionsState.permissionGranted) {
|
if (notificationsPermissionsState.permissionGranted) {
|
||||||
|
|
@ -78,7 +78,7 @@ class NotificationsOptInPresenter(
|
||||||
|
|
||||||
return NotificationsOptInState(
|
return NotificationsOptInState(
|
||||||
notificationsPermissionState = notificationsPermissionsState,
|
notificationsPermissionState = notificationsPermissionsState,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ class HomePresenter(
|
||||||
val showAvatarIndicator by indicatorService.showRoomListTopBarIndicator()
|
val showAvatarIndicator by indicatorService.showRoomListTopBarIndicator()
|
||||||
val directLogoutState = logoutPresenter.present()
|
val directLogoutState = logoutPresenter.present()
|
||||||
|
|
||||||
fun handleEvents(event: HomeEvents) {
|
fun handleEvent(event: HomeEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is HomeEvents.SelectHomeNavigationBarItem -> coroutineState.launch {
|
is HomeEvents.SelectHomeNavigationBarItem -> coroutineState.launch {
|
||||||
if (event.item == HomeNavigationBarItem.Spaces) {
|
if (event.item == HomeNavigationBarItem.Spaces) {
|
||||||
|
|
@ -117,7 +117,7 @@ class HomePresenter(
|
||||||
canReportBug = canReportBug,
|
canReportBug = canReportBug,
|
||||||
directLogoutState = directLogoutState,
|
directLogoutState = directLogoutState,
|
||||||
isSpaceFeatureEnabled = isSpaceFeatureEnabled,
|
isSpaceFeatureEnabled = isSpaceFeatureEnabled,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class RoomListFiltersPresenter(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): RoomListFiltersState {
|
override fun present(): RoomListFiltersState {
|
||||||
fun handleEvents(event: RoomListFiltersEvents) {
|
fun handleEvent(event: RoomListFiltersEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
RoomListFiltersEvents.ClearSelectedFilters -> {
|
RoomListFiltersEvents.ClearSelectedFilters -> {
|
||||||
filterSelectionStrategy.clear()
|
filterSelectionStrategy.clear()
|
||||||
|
|
@ -63,7 +63,7 @@ class RoomListFiltersPresenter(
|
||||||
|
|
||||||
return RoomListFiltersState(
|
return RoomListFiltersState(
|
||||||
filterSelectionStates = filters,
|
filterSelectionStates = filters,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ class RoomListPresenter(
|
||||||
val contextMenu = remember { mutableStateOf<RoomListState.ContextMenu>(RoomListState.ContextMenu.Hidden) }
|
val contextMenu = remember { mutableStateOf<RoomListState.ContextMenu>(RoomListState.ContextMenu.Hidden) }
|
||||||
val declineInviteMenu = remember { mutableStateOf<RoomListState.DeclineInviteMenu>(RoomListState.DeclineInviteMenu.Hidden) }
|
val declineInviteMenu = remember { mutableStateOf<RoomListState.DeclineInviteMenu>(RoomListState.DeclineInviteMenu.Hidden) }
|
||||||
|
|
||||||
fun handleEvents(event: RoomListEvents) {
|
fun handleEvent(event: RoomListEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomListEvents.UpdateVisibleRange -> coroutineScope.launch {
|
is RoomListEvents.UpdateVisibleRange -> coroutineScope.launch {
|
||||||
updateVisibleRange(event.range)
|
updateVisibleRange(event.range)
|
||||||
|
|
@ -169,7 +169,7 @@ class RoomListPresenter(
|
||||||
acceptDeclineInviteState = acceptDeclineInviteState,
|
acceptDeclineInviteState = acceptDeclineInviteState,
|
||||||
hideInvitesAvatars = hideInvitesAvatar,
|
hideInvitesAvatars = hideInvitesAvatar,
|
||||||
canReportRoom = canReportRoom,
|
canReportRoom = canReportRoom,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class RoomListSearchPresenter(
|
||||||
dataSource.setSearchQuery(searchQuery)
|
dataSource.setSearchQuery(searchQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RoomListSearchEvents) {
|
fun handleEvent(event: RoomListSearchEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
RoomListSearchEvents.ClearQuery -> {
|
RoomListSearchEvents.ClearQuery -> {
|
||||||
searchQuery = ""
|
searchQuery = ""
|
||||||
|
|
@ -61,7 +61,7 @@ class RoomListSearchPresenter(
|
||||||
isSearchActive = isSearchActive,
|
isSearchActive = isSearchActive,
|
||||||
query = searchQuery,
|
query = searchQuery,
|
||||||
results = searchResults,
|
results = searchResults,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class HomeSpacesPresenter(
|
||||||
seenInvitesStore.seenRoomIds().map { it.toImmutableSet() }
|
seenInvitesStore.seenRoomIds().map { it.toImmutableSet() }
|
||||||
}.collectAsState(persistentSetOf())
|
}.collectAsState(persistentSetOf())
|
||||||
|
|
||||||
fun handleEvents(event: HomeSpacesEvents) {
|
fun handleEvent(event: HomeSpacesEvents) {
|
||||||
// when (event) { }
|
// when (event) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ class HomeSpacesPresenter(
|
||||||
spaceRooms = spaceRooms,
|
spaceRooms = spaceRooms,
|
||||||
seenSpaceInvites = seenSpaceInvites,
|
seenSpaceInvites = seenSpaceInvites,
|
||||||
hideInvitesAvatar = hideInvitesAvatar,
|
hideInvitesAvatar = hideInvitesAvatar,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class AcceptDeclineInvitePresenter(
|
||||||
val declinedAction: MutableState<AsyncAction<RoomId>> =
|
val declinedAction: MutableState<AsyncAction<RoomId>> =
|
||||||
remember { mutableStateOf(AsyncAction.Uninitialized) }
|
remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
|
|
||||||
fun handleEvents(event: AcceptDeclineInviteEvents) {
|
fun handleEvent(event: AcceptDeclineInviteEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is AcceptDeclineInviteEvents.AcceptInvite -> {
|
is AcceptDeclineInviteEvents.AcceptInvite -> {
|
||||||
localCoroutineScope.acceptInvite(event.invite.roomId, acceptedAction)
|
localCoroutineScope.acceptInvite(event.invite.roomId, acceptedAction)
|
||||||
|
|
@ -70,7 +70,7 @@ class AcceptDeclineInvitePresenter(
|
||||||
return AcceptDeclineInviteState(
|
return AcceptDeclineInviteState(
|
||||||
acceptAction = acceptedAction.value,
|
acceptAction = acceptedAction.value,
|
||||||
declineAction = declinedAction.value,
|
declineAction = declinedAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class DeclineAndBlockPresenter(
|
||||||
|
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: DeclineAndBlockEvents) {
|
fun handleEvent(event: DeclineAndBlockEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
DeclineAndBlockEvents.ClearDeclineAction -> declineAction.value = AsyncAction.Uninitialized
|
DeclineAndBlockEvents.ClearDeclineAction -> declineAction.value = AsyncAction.Uninitialized
|
||||||
DeclineAndBlockEvents.Decline -> coroutineScope.decline(reportReason, blockUser, reportRoom, declineAction)
|
DeclineAndBlockEvents.Decline -> coroutineScope.decline(reportReason, blockUser, reportRoom, declineAction)
|
||||||
|
|
@ -63,7 +63,7 @@ class DeclineAndBlockPresenter(
|
||||||
reportReason = reportReason,
|
reportReason = reportReason,
|
||||||
blockUser = blockUser,
|
blockUser = blockUser,
|
||||||
declineAction = declineAction.value,
|
declineAction = declineAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class DefaultInvitePeoplePresenter(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: InvitePeopleEvents) {
|
fun handleEvent(event: InvitePeopleEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is DefaultInvitePeopleEvents.OnSearchActiveChanged -> {
|
is DefaultInvitePeopleEvents.OnSearchActiveChanged -> {
|
||||||
searchActive = event.active
|
searchActive = event.active
|
||||||
|
|
@ -139,7 +139,7 @@ class DefaultInvitePeoplePresenter(
|
||||||
searchResults = searchResults.value,
|
searchResults = searchResults.value,
|
||||||
showSearchLoader = showSearchLoader.value,
|
showSearchLoader = showSearchLoader.value,
|
||||||
sendInvitesAction = sendInvitesAction.value,
|
sendInvitesAction = sendInvitesAction.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ class JoinRoomPresenter(
|
||||||
contentState.markRoomInviteAsSeen()
|
contentState.markRoomInviteAsSeen()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: JoinRoomEvents) {
|
fun handleEvent(event: JoinRoomEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
JoinRoomEvents.JoinRoom -> coroutineScope.joinRoom(joinAction)
|
JoinRoomEvents.JoinRoom -> coroutineScope.joinRoom(joinAction)
|
||||||
is JoinRoomEvents.KnockRoom -> coroutineScope.knockRoom(knockAction, knockMessage)
|
is JoinRoomEvents.KnockRoom -> coroutineScope.knockRoom(knockAction, knockMessage)
|
||||||
|
|
@ -197,7 +197,7 @@ class JoinRoomPresenter(
|
||||||
knockMessage = knockMessage,
|
knockMessage = knockMessage,
|
||||||
hideInviteAvatars = hideInviteAvatars,
|
hideInviteAvatars = hideInviteAvatars,
|
||||||
canReportRoom = canReportRoom,
|
canReportRoom = canReportRoom,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class KnockRequestsBannerPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: KnockRequestsBannerEvents) {
|
fun handleEvent(event: KnockRequestsBannerEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is KnockRequestsBannerEvents.AcceptSingleRequest -> {
|
is KnockRequestsBannerEvents.AcceptSingleRequest -> {
|
||||||
sessionCoroutineScope.acceptSingleKnockRequest(
|
sessionCoroutineScope.acceptSingleKnockRequest(
|
||||||
|
|
@ -73,7 +73,7 @@ class KnockRequestsBannerPresenter(
|
||||||
displayAcceptError = showAcceptError.value,
|
displayAcceptError = showAcceptError.value,
|
||||||
canAccept = permissions.canAccept,
|
canAccept = permissions.canAccept,
|
||||||
isVisible = shouldShowBanner,
|
isVisible = shouldShowBanner,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class KnockRequestsListPresenter(
|
||||||
|
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: KnockRequestsListEvents) {
|
fun handleEvent(event: KnockRequestsListEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
KnockRequestsListEvents.AcceptAll -> {
|
KnockRequestsListEvents.AcceptAll -> {
|
||||||
currentAction = KnockRequestsAction.AcceptAll
|
currentAction = KnockRequestsAction.AcceptAll
|
||||||
|
|
@ -73,7 +73,7 @@ class KnockRequestsListPresenter(
|
||||||
currentAction = currentAction,
|
currentAction = currentAction,
|
||||||
permissions = permissions,
|
permissions = permissions,
|
||||||
asyncAction = asyncAction.value,
|
asyncAction = asyncAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class DefaultPermissionsPresenter(
|
||||||
override fun present(): PermissionsState {
|
override fun present(): PermissionsState {
|
||||||
val multiplePermissionsState = rememberMultiplePermissionsState(permissions = permissions)
|
val multiplePermissionsState = rememberMultiplePermissionsState(permissions = permissions)
|
||||||
|
|
||||||
fun handleEvents(event: PermissionsEvents) {
|
fun handleEvent(event: PermissionsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
PermissionsEvents.RequestPermissions -> multiplePermissionsState.launchMultiplePermissionRequest()
|
PermissionsEvents.RequestPermissions -> multiplePermissionsState.launchMultiplePermissionRequest()
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +46,7 @@ class DefaultPermissionsPresenter(
|
||||||
else -> PermissionsState.Permissions.NoneGranted
|
else -> PermissionsState.Permissions.NoneGranted
|
||||||
},
|
},
|
||||||
shouldShowRationale = multiplePermissionsState.shouldShowRationale,
|
shouldShowRationale = multiplePermissionsState.shouldShowRationale,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ class SendLocationPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: SendLocationEvents) {
|
fun handleEvent(event: SendLocationEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is SendLocationEvents.SendLocation -> scope.launch {
|
is SendLocationEvents.SendLocation -> scope.launch {
|
||||||
sendLocation(event, mode)
|
sendLocation(event, mode)
|
||||||
|
|
@ -103,7 +103,7 @@ class SendLocationPresenter(
|
||||||
mode = mode,
|
mode = mode,
|
||||||
hasLocationPermission = permissionsState.isAnyGranted,
|
hasLocationPermission = permissionsState.isAnyGranted,
|
||||||
appName = appName,
|
appName = appName,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class ShowLocationPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: ShowLocationEvents) {
|
fun handleEvent(event: ShowLocationEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ShowLocationEvents.Share -> locationActions.share(location, description)
|
ShowLocationEvents.Share -> locationActions.share(location, description)
|
||||||
is ShowLocationEvents.TrackMyLocation -> {
|
is ShowLocationEvents.TrackMyLocation -> {
|
||||||
|
|
@ -86,7 +86,7 @@ class ShowLocationPresenter(
|
||||||
hasLocationPermission = permissionsState.isAnyGranted,
|
hasLocationPermission = permissionsState.isAnyGranted,
|
||||||
isTrackMyLocation = isTrackMyLocation,
|
isTrackMyLocation = isTrackMyLocation,
|
||||||
appName = appName,
|
appName = appName,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ class FakePermissionsPresenter : PermissionsPresenter {
|
||||||
private var state = PermissionsState(
|
private var state = PermissionsState(
|
||||||
permissions = PermissionsState.Permissions.NoneGranted,
|
permissions = PermissionsState.Permissions.NoneGranted,
|
||||||
shouldShowRationale = false,
|
shouldShowRationale = false,
|
||||||
eventSink = ::handleEvent
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value.copy(eventSink = ::handleEvent)
|
field = value.copy(eventSink = ::handleEvent)
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class LockScreenSettingsPresenter(
|
||||||
|
|
||||||
val biometricUnlock = biometricAuthenticatorManager.rememberConfirmBiometricAuthenticator()
|
val biometricUnlock = biometricAuthenticatorManager.rememberConfirmBiometricAuthenticator()
|
||||||
|
|
||||||
fun handleEvents(event: LockScreenSettingsEvents) {
|
fun handleEvent(event: LockScreenSettingsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
LockScreenSettingsEvents.CancelRemovePin -> showRemovePinConfirmation = false
|
LockScreenSettingsEvents.CancelRemovePin -> showRemovePinConfirmation = false
|
||||||
LockScreenSettingsEvents.ConfirmRemovePin -> {
|
LockScreenSettingsEvents.ConfirmRemovePin -> {
|
||||||
|
|
@ -82,7 +82,7 @@ class LockScreenSettingsPresenter(
|
||||||
isBiometricEnabled = isBiometricEnabled,
|
isBiometricEnabled = isBiometricEnabled,
|
||||||
showRemovePinConfirmation = showRemovePinConfirmation,
|
showRemovePinConfirmation = showRemovePinConfirmation,
|
||||||
showToggleBiometric = biometricAuthenticatorManager.isDeviceSecured,
|
showToggleBiometric = biometricAuthenticatorManager.isDeviceSecured,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class SetupBiometricPresenter(
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val biometricUnlock = biometricAuthenticatorManager.rememberConfirmBiometricAuthenticator()
|
val biometricUnlock = biometricAuthenticatorManager.rememberConfirmBiometricAuthenticator()
|
||||||
|
|
||||||
fun handleEvents(event: SetupBiometricEvents) {
|
fun handleEvent(event: SetupBiometricEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SetupBiometricEvents.AllowBiometric -> coroutineScope.launch {
|
SetupBiometricEvents.AllowBiometric -> coroutineScope.launch {
|
||||||
biometricUnlock.setup()
|
biometricUnlock.setup()
|
||||||
|
|
@ -52,7 +52,7 @@ class SetupBiometricPresenter(
|
||||||
|
|
||||||
return SetupBiometricState(
|
return SetupBiometricState(
|
||||||
isBiometricSetupDone = isBiometricSetupDone,
|
isBiometricSetupDone = isBiometricSetupDone,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class SetupPinPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: SetupPinEvents) {
|
fun handleEvent(event: SetupPinEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is SetupPinEvents.OnPinEntryChanged -> {
|
is SetupPinEvents.OnPinEntryChanged -> {
|
||||||
// Use the fromConfirmationStep flag from ui to avoid race condition.
|
// Use the fromConfirmationStep flag from ui to avoid race condition.
|
||||||
|
|
@ -106,7 +106,7 @@ class SetupPinPresenter(
|
||||||
isConfirmationStep = isConfirmationStep,
|
isConfirmationStep = isConfirmationStep,
|
||||||
setupPinFailure = setupPinFailure,
|
setupPinFailure = setupPinFailure,
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ class PinUnlockPresenter(
|
||||||
isUnlocked.value = true
|
isUnlocked.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: PinUnlockEvents) {
|
fun handleEvent(event: PinUnlockEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is PinUnlockEvents.OnPinKeypadPressed -> {
|
is PinUnlockEvents.OnPinKeypadPressed -> {
|
||||||
pinEntryState.value = pinEntry.process(event.pinKeypadModel)
|
pinEntryState.value = pinEntry.process(event.pinKeypadModel)
|
||||||
|
|
@ -129,7 +129,7 @@ class PinUnlockPresenter(
|
||||||
showBiometricUnlock = biometricUnlock.isActive,
|
showBiometricUnlock = biometricUnlock.isActive,
|
||||||
biometricUnlockResult = biometricUnlockResult,
|
biometricUnlockResult = biometricUnlockResult,
|
||||||
isUnlocked = isUnlocked.value,
|
isUnlocked = isUnlocked.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class ChangeServerPresenter(
|
||||||
mutableStateOf(AsyncData.Uninitialized)
|
mutableStateOf(AsyncData.Uninitialized)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: ChangeServerEvents) {
|
fun handleEvent(event: ChangeServerEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is ChangeServerEvents.ChangeServer -> localCoroutineScope.changeServer(event.accountProvider, changeServerAction)
|
is ChangeServerEvents.ChangeServer -> localCoroutineScope.changeServer(event.accountProvider, changeServerAction)
|
||||||
ChangeServerEvents.ClearError -> changeServerAction.value = AsyncData.Uninitialized
|
ChangeServerEvents.ClearError -> changeServerAction.value = AsyncData.Uninitialized
|
||||||
|
|
@ -47,7 +47,7 @@ class ChangeServerPresenter(
|
||||||
|
|
||||||
return ChangeServerState(
|
return ChangeServerState(
|
||||||
changeServerAction = changeServerAction.value,
|
changeServerAction = changeServerAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class ConfirmAccountProviderPresenter(
|
||||||
|
|
||||||
val loginMode by loginHelper.collectLoginMode()
|
val loginMode by loginHelper.collectLoginMode()
|
||||||
|
|
||||||
fun handleEvents(event: ConfirmAccountProviderEvents) {
|
fun handleEvent(event: ConfirmAccountProviderEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ConfirmAccountProviderEvents.Continue -> {
|
ConfirmAccountProviderEvents.Continue -> {
|
||||||
loginHelper.submit(
|
loginHelper.submit(
|
||||||
|
|
@ -58,7 +58,7 @@ class ConfirmAccountProviderPresenter(
|
||||||
accountProvider = accountProvider,
|
accountProvider = accountProvider,
|
||||||
isAccountCreation = params.isAccountCreation,
|
isAccountCreation = params.isAccountCreation,
|
||||||
loginMode = loginMode,
|
loginMode = loginMode,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class CreateAccountPresenter(
|
||||||
val pageProgress: MutableState<Int> = remember { mutableIntStateOf(0) }
|
val pageProgress: MutableState<Int> = remember { mutableIntStateOf(0) }
|
||||||
val createAction: MutableState<AsyncAction<SessionId>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val createAction: MutableState<AsyncAction<SessionId>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
|
|
||||||
fun handleEvents(event: CreateAccountEvents) {
|
fun handleEvent(event: CreateAccountEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is CreateAccountEvents.SetPageProgress -> {
|
is CreateAccountEvents.SetPageProgress -> {
|
||||||
pageProgress.value = event.progress
|
pageProgress.value = event.progress
|
||||||
|
|
@ -68,7 +68,7 @@ class CreateAccountPresenter(
|
||||||
pageProgress = pageProgress.value,
|
pageProgress = pageProgress.value,
|
||||||
isDebugBuild = buildMeta.isDebuggable,
|
isDebugBuild = buildMeta.isDebuggable,
|
||||||
createAction = createAction.value,
|
createAction = createAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class LoginPasswordPresenter(
|
||||||
}
|
}
|
||||||
val accountProvider by accountProviderDataSource.flow.collectAsState()
|
val accountProvider by accountProviderDataSource.flow.collectAsState()
|
||||||
|
|
||||||
fun handleEvents(event: LoginPasswordEvents) {
|
fun handleEvent(event: LoginPasswordEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is LoginPasswordEvents.SetLogin -> updateFormState(formState) {
|
is LoginPasswordEvents.SetLogin -> updateFormState(formState) {
|
||||||
copy(login = event.login)
|
copy(login = event.login)
|
||||||
|
|
@ -60,7 +60,7 @@ class LoginPasswordPresenter(
|
||||||
accountProvider = accountProvider,
|
accountProvider = accountProvider,
|
||||||
formState = formState.value,
|
formState = formState.value,
|
||||||
loginAction = loginAction.value,
|
loginAction = loginAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class QrCodeIntroPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: QrCodeIntroEvents) {
|
fun handleEvent(event: QrCodeIntroEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
QrCodeIntroEvents.Continue -> if (cameraPermissionState.permissionGranted) {
|
QrCodeIntroEvents.Continue -> if (cameraPermissionState.permissionGranted) {
|
||||||
canContinue = true
|
canContinue = true
|
||||||
|
|
@ -55,7 +55,7 @@ class QrCodeIntroPresenter(
|
||||||
desktopAppName = buildMeta.desktopApplicationName,
|
desktopAppName = buildMeta.desktopApplicationName,
|
||||||
cameraPermissionState = cameraPermissionState,
|
cameraPermissionState = cameraPermissionState,
|
||||||
canContinue = canContinue,
|
canContinue = canContinue,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class QrCodeScanPresenter(
|
||||||
authenticationAction.value = AsyncAction.Failure(it)
|
authenticationAction.value = AsyncAction.Failure(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: QrCodeScanEvents) {
|
fun handleEvent(event: QrCodeScanEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
QrCodeScanEvents.TryAgain -> {
|
QrCodeScanEvents.TryAgain -> {
|
||||||
isScanning = true
|
isScanning = true
|
||||||
|
|
@ -69,7 +69,7 @@ class QrCodeScanPresenter(
|
||||||
return QrCodeScanState(
|
return QrCodeScanState(
|
||||||
isScanning = isScanning,
|
isScanning = isScanning,
|
||||||
authenticationAction = authenticationAction.value,
|
authenticationAction = authenticationAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class SearchAccountProviderPresenter(
|
||||||
onUserInput(userInput, data)
|
onUserInput(userInput, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: SearchAccountProviderEvents) {
|
fun handleEvent(event: SearchAccountProviderEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is SearchAccountProviderEvents.UserInput -> {
|
is SearchAccountProviderEvents.UserInput -> {
|
||||||
userInput = event.input
|
userInput = event.input
|
||||||
|
|
@ -57,7 +57,7 @@ class SearchAccountProviderPresenter(
|
||||||
userInput = userInput,
|
userInput = userInput,
|
||||||
userInputResult = data.value,
|
userInputResult = data.value,
|
||||||
changeServerState = changeServerState,
|
changeServerState = changeServerState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class LogoutPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: LogoutEvents) {
|
fun handleEvent(event: LogoutEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is LogoutEvents.Logout -> {
|
is LogoutEvents.Logout -> {
|
||||||
if (logoutAction.value.isConfirming() || event.ignoreSdkError) {
|
if (logoutAction.value.isConfirming() || event.ignoreSdkError) {
|
||||||
|
|
@ -96,7 +96,7 @@ class LogoutPresenter(
|
||||||
backupUploadState = backupUploadState,
|
backupUploadState = backupUploadState,
|
||||||
waitingForALongTime = waitingForALongTime,
|
waitingForALongTime = waitingForALongTime,
|
||||||
logoutAction = logoutAction.value,
|
logoutAction = logoutAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class DirectLogoutPresenter(
|
||||||
|
|
||||||
val isLastDevice by encryptionService.isLastDevice.collectAsState()
|
val isLastDevice by encryptionService.isLastDevice.collectAsState()
|
||||||
|
|
||||||
fun handleEvents(event: DirectLogoutEvents) {
|
fun handleEvent(event: DirectLogoutEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is DirectLogoutEvents.Logout -> {
|
is DirectLogoutEvents.Logout -> {
|
||||||
if (logoutAction.value.isConfirming() || event.ignoreSdkError) {
|
if (logoutAction.value.isConfirming() || event.ignoreSdkError) {
|
||||||
|
|
@ -66,7 +66,7 @@ class DirectLogoutPresenter(
|
||||||
canDoDirectSignOut = !isLastDevice &&
|
canDoDirectSignOut = !isLastDevice &&
|
||||||
!backupUploadState.isBackingUp(),
|
!backupUploadState.isBackingUp(),
|
||||||
logoutAction = logoutAction.value,
|
logoutAction = logoutAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ class MessagesPresenter(
|
||||||
onPauseOrDispose {}
|
onPauseOrDispose {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: MessagesEvents) {
|
fun handleEvent(event: MessagesEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is MessagesEvents.HandleAction -> {
|
is MessagesEvents.HandleAction -> {
|
||||||
localCoroutineScope.handleTimelineAction(
|
localCoroutineScope.handleTimelineAction(
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class DefaultActionListPresenter(
|
||||||
|
|
||||||
val isThreadsEnabled = featureFlagService.isFeatureEnabledFlow(FeatureFlags.Threads).collectAsState(false)
|
val isThreadsEnabled = featureFlagService.isFeatureEnabledFlow(FeatureFlags.Threads).collectAsState(false)
|
||||||
|
|
||||||
fun handleEvents(event: ActionListEvents) {
|
fun handleEvent(event: ActionListEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ActionListEvents.Clear -> target.value = ActionListState.Target.None
|
ActionListEvents.Clear -> target.value = ActionListState.Target.None
|
||||||
is ActionListEvents.ComputeForMessage -> localCoroutineScope.computeForMessage(
|
is ActionListEvents.ComputeForMessage -> localCoroutineScope.computeForMessage(
|
||||||
|
|
@ -122,7 +122,7 @@ class DefaultActionListPresenter(
|
||||||
|
|
||||||
return ActionListState(
|
return ActionListState(
|
||||||
target = target.value,
|
target = target.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ class AttachmentsPreviewPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(attachmentsPreviewEvents: AttachmentsPreviewEvents) {
|
fun handleEvent(attachmentsPreviewEvents: AttachmentsPreviewEvents) {
|
||||||
when (attachmentsPreviewEvents) {
|
when (attachmentsPreviewEvents) {
|
||||||
is AttachmentsPreviewEvents.SendAttachment -> {
|
is AttachmentsPreviewEvents.SendAttachment -> {
|
||||||
ongoingSendAttachmentJob.value = coroutineScope.launch {
|
ongoingSendAttachmentJob.value = coroutineScope.launch {
|
||||||
|
|
@ -230,7 +230,7 @@ class AttachmentsPreviewPresenter(
|
||||||
textEditorState = textEditorState,
|
textEditorState = textEditorState,
|
||||||
mediaOptimizationSelectorState = mediaOptimizationSelectorState,
|
mediaOptimizationSelectorState = mediaOptimizationSelectorState,
|
||||||
displayFileTooLargeError = displayFileTooLargeError,
|
displayFileTooLargeError = displayFileTooLargeError,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class ResolveVerifiedUserSendFailurePresenter(
|
||||||
}
|
}
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: ResolveVerifiedUserSendFailureEvents) {
|
fun handleEvent(event: ResolveVerifiedUserSendFailureEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is ResolveVerifiedUserSendFailureEvents.ComputeForMessage -> {
|
is ResolveVerifiedUserSendFailureEvents.ComputeForMessage -> {
|
||||||
val sendState = event.messageEvent.localSendState as? LocalEventSendState.Failed.VerifiedUser
|
val sendState = event.messageEvent.localSendState as? LocalEventSendState.Failed.VerifiedUser
|
||||||
|
|
@ -92,7 +92,7 @@ class ResolveVerifiedUserSendFailurePresenter(
|
||||||
verifiedUserSendFailure = verifiedUserSendFailure,
|
verifiedUserSendFailure = verifiedUserSendFailure,
|
||||||
resolveAction = resolveAction.value,
|
resolveAction = resolveAction.value,
|
||||||
retryAction = retryAction.value,
|
retryAction = retryAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class LinkPresenter(
|
||||||
override fun present(): LinkState {
|
override fun present(): LinkState {
|
||||||
val linkClick: MutableState<AsyncAction<Link>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val linkClick: MutableState<AsyncAction<Link>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
|
|
||||||
fun handleEvents(linkEvents: LinkEvents) {
|
fun handleEvent(linkEvents: LinkEvents) {
|
||||||
when (linkEvents) {
|
when (linkEvents) {
|
||||||
is LinkEvents.OnLinkClick -> {
|
is LinkEvents.OnLinkClick -> {
|
||||||
linkClick.value = AsyncAction.Loading
|
linkClick.value = AsyncAction.Loading
|
||||||
|
|
@ -48,7 +48,7 @@ class LinkPresenter(
|
||||||
}
|
}
|
||||||
return LinkState(
|
return LinkState(
|
||||||
linkClick = linkClick.value,
|
linkClick = linkClick.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ class MessageComposerPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: MessageComposerEvents) {
|
fun handleEvent(event: MessageComposerEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
MessageComposerEvents.ToggleFullScreenState -> isFullScreen.value = !isFullScreen.value
|
MessageComposerEvents.ToggleFullScreenState -> isFullScreen.value = !isFullScreen.value
|
||||||
MessageComposerEvents.CloseSpecialMode -> {
|
MessageComposerEvents.CloseSpecialMode -> {
|
||||||
|
|
@ -382,7 +382,7 @@ class MessageComposerPresenter(
|
||||||
suggestions = suggestions.toImmutableList(),
|
suggestions = suggestions.toImmutableList(),
|
||||||
resolveMentionDisplay = resolveMentionDisplay,
|
resolveMentionDisplay = resolveMentionDisplay,
|
||||||
resolveAtRoomMentionDisplay = resolveAtRoomMentionDisplay,
|
resolveAtRoomMentionDisplay = resolveAtRoomMentionDisplay,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class PinnedMessagesBannerPresenter(
|
||||||
expectedPinnedMessagesCount = expectedPinnedMessagesCount,
|
expectedPinnedMessagesCount = expectedPinnedMessagesCount,
|
||||||
pinnedItems = pinnedItems.value,
|
pinnedItems = pinnedItems.value,
|
||||||
currentPinnedMessageIndex = currentPinnedMessageIndex,
|
currentPinnedMessageIndex = currentPinnedMessageIndex,
|
||||||
eventSink = ::handleEvent
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ class PinnedMessagesListPresenter(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
fun handleEvents(event: PinnedMessagesListEvents) {
|
fun handleEvent(event: PinnedMessagesListEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is PinnedMessagesListEvents.HandleAction -> sessionCoroutineScope.handleTimelineAction(event.action, event.event)
|
is PinnedMessagesListEvents.HandleAction -> sessionCoroutineScope.handleTimelineAction(event.action, event.event)
|
||||||
}
|
}
|
||||||
|
|
@ -143,7 +143,7 @@ class PinnedMessagesListPresenter(
|
||||||
displayThreadSummaries = displayThreadSummaries,
|
displayThreadSummaries = displayThreadSummaries,
|
||||||
userEventPermissions = userEventPermissions,
|
userEventPermissions = userEventPermissions,
|
||||||
timelineItems = pinnedMessageItems,
|
timelineItems = pinnedMessageItems,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class ReportMessagePresenter(
|
||||||
var blockUser by rememberSaveable { mutableStateOf(false) }
|
var blockUser by rememberSaveable { mutableStateOf(false) }
|
||||||
var result: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
var result: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
|
|
||||||
fun handleEvents(event: ReportMessageEvents) {
|
fun handleEvent(event: ReportMessageEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is ReportMessageEvents.UpdateReason -> reason = event.reason
|
is ReportMessageEvents.UpdateReason -> reason = event.reason
|
||||||
ReportMessageEvents.ToggleBlockUser -> blockUser = !blockUser
|
ReportMessageEvents.ToggleBlockUser -> blockUser = !blockUser
|
||||||
|
|
@ -66,7 +66,7 @@ class ReportMessagePresenter(
|
||||||
reason = reason,
|
reason = reason,
|
||||||
blockUser = blockUser,
|
blockUser = blockUser,
|
||||||
result = result.value,
|
result = result.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ class TimelinePresenter(
|
||||||
value = featureFlagService.isFeatureEnabled(FeatureFlags.Threads)
|
value = featureFlagService.isFeatureEnabled(FeatureFlags.Threads)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: TimelineEvents) {
|
fun handleEvent(event: TimelineEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is TimelineEvents.LoadMore -> {
|
is TimelineEvents.LoadMore -> {
|
||||||
if (event.direction == Timeline.PaginationDirection.FORWARDS && timelineMode is Timeline.Mode.Thread) {
|
if (event.direction == Timeline.PaginationDirection.FORWARDS && timelineMode is Timeline.Mode.Thread) {
|
||||||
|
|
@ -289,7 +289,7 @@ class TimelinePresenter(
|
||||||
messageShield = messageShield.value,
|
messageShield = messageShield.value,
|
||||||
resolveVerifiedUserSendFailureState = resolveVerifiedUserSendFailureState,
|
resolveVerifiedUserSendFailureState = resolveVerifiedUserSendFailureState,
|
||||||
displayThreadSummaries = displayThreadSummaries,
|
displayThreadSummaries = displayThreadSummaries,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class CustomReactionPresenter(
|
||||||
target.value = CustomReactionState.Target.None
|
target.value = CustomReactionState.Target.None
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: CustomReactionEvents) {
|
fun handleEvent(event: CustomReactionEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is CustomReactionEvents.ShowCustomReactionSheet -> handleShowCustomReactionSheet(event.event)
|
is CustomReactionEvents.ShowCustomReactionSheet -> handleShowCustomReactionSheet(event.event)
|
||||||
is CustomReactionEvents.DismissCustomReactionSheet -> handleDismissCustomReactionSheet()
|
is CustomReactionEvents.DismissCustomReactionSheet -> handleDismissCustomReactionSheet()
|
||||||
|
|
@ -71,7 +71,7 @@ class CustomReactionPresenter(
|
||||||
target = target.value,
|
target = target.value,
|
||||||
selectedEmoji = selectedEmoji,
|
selectedEmoji = selectedEmoji,
|
||||||
recentEmojis = recentEmojis,
|
recentEmojis = recentEmojis,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ class EmojiPickerPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
val isInPreview = LocalInspectionMode.current
|
val isInPreview = LocalInspectionMode.current
|
||||||
fun handleEvents(event: EmojiPickerEvents) {
|
fun handleEvent(event: EmojiPickerEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
// For some reason, in preview mode the SearchBar emits this event with an `isActive = true` value automatically
|
// For some reason, in preview mode the SearchBar emits this event with an `isActive = true` value automatically
|
||||||
is EmojiPickerEvents.ToggleSearchActive -> if (!isInPreview) {
|
is EmojiPickerEvents.ToggleSearchActive -> if (!isInPreview) {
|
||||||
|
|
@ -106,7 +106,7 @@ class EmojiPickerPresenter(
|
||||||
searchQuery = searchQuery,
|
searchQuery = searchQuery,
|
||||||
isSearchActive = isSearchActive,
|
isSearchActive = isSearchActive,
|
||||||
searchResults = emojiResults,
|
searchResults = emojiResults,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class ReactionSummaryPresenter(
|
||||||
}
|
}
|
||||||
val targetWithAvatars = populateSenderAvatars(members = membersState.roomMembers().orEmpty().toImmutableList(), summary = target.value)
|
val targetWithAvatars = populateSenderAvatars(members = membersState.roomMembers().orEmpty().toImmutableList(), summary = target.value)
|
||||||
|
|
||||||
fun handleEvents(event: ReactionSummaryEvents) {
|
fun handleEvent(event: ReactionSummaryEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is ReactionSummaryEvents.ShowReactionSummary -> target.value = ReactionSummaryState.Summary(
|
is ReactionSummaryEvents.ShowReactionSummary -> target.value = ReactionSummaryState.Summary(
|
||||||
reactions = event.reactions.toImmutableList(),
|
reactions = event.reactions.toImmutableList(),
|
||||||
|
|
@ -48,7 +48,7 @@ class ReactionSummaryPresenter(
|
||||||
}
|
}
|
||||||
return ReactionSummaryState(
|
return ReactionSummaryState(
|
||||||
target = targetWithAvatars.value,
|
target = targetWithAvatars.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class CreatePollPresenter(
|
||||||
|
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: CreatePollEvents) {
|
fun handleEvent(event: CreatePollEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is CreatePollEvents.Save -> scope.launch {
|
is CreatePollEvents.Save -> scope.launch {
|
||||||
if (canSave) {
|
if (canSave) {
|
||||||
|
|
@ -183,7 +183,7 @@ class CreatePollPresenter(
|
||||||
pollKind = poll.pollKind,
|
pollKind = poll.pollKind,
|
||||||
showBackConfirmation = showBackConfirmation,
|
showBackConfirmation = showBackConfirmation,
|
||||||
showDeleteConfirmation = showDeleteConfirmation,
|
showDeleteConfirmation = showDeleteConfirmation,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class PollHistoryPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
fun handleEvents(event: PollHistoryEvents) {
|
fun handleEvent(event: PollHistoryEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is PollHistoryEvents.LoadMore -> {
|
is PollHistoryEvents.LoadMore -> {
|
||||||
coroutineScope.loadMore(timeline)
|
coroutineScope.loadMore(timeline)
|
||||||
|
|
@ -88,7 +88,7 @@ class PollHistoryPresenter(
|
||||||
hasMoreToLoad = paginationState.hasMoreToLoad,
|
hasMoreToLoad = paginationState.hasMoreToLoad,
|
||||||
pollHistoryItems = pollHistoryItems,
|
pollHistoryItems = pollHistoryItems,
|
||||||
activeFilter = activeFilter,
|
activeFilter = activeFilter,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class AdvancedSettingsPresenter(
|
||||||
}.collect()
|
}.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: AdvancedSettingsEvents) {
|
fun handleEvent(event: AdvancedSettingsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is AdvancedSettingsEvents.SetDeveloperModeEnabled -> sessionCoroutineScope.launch {
|
is AdvancedSettingsEvents.SetDeveloperModeEnabled -> sessionCoroutineScope.launch {
|
||||||
appPreferencesStore.setDeveloperModeEnabled(event.enabled)
|
appPreferencesStore.setDeveloperModeEnabled(event.enabled)
|
||||||
|
|
@ -117,7 +117,7 @@ class AdvancedSettingsPresenter(
|
||||||
mediaOptimizationState = mediaOptimizationState,
|
mediaOptimizationState = mediaOptimizationState,
|
||||||
theme = themeOption,
|
theme = themeOption,
|
||||||
mediaPreviewConfigState = mediaPreviewConfigState,
|
mediaPreviewConfigState = mediaPreviewConfigState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class BlockedUsersPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: BlockedUsersEvents) {
|
fun handleEvent(event: BlockedUsersEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is BlockedUsersEvents.Unblock -> {
|
is BlockedUsersEvents.Unblock -> {
|
||||||
pendingUserToUnblock = event.userId
|
pendingUserToUnblock = event.userId
|
||||||
|
|
@ -85,7 +85,7 @@ class BlockedUsersPresenter(
|
||||||
return BlockedUsersState(
|
return BlockedUsersState(
|
||||||
blockedUsers = ignoredMatrixUser.toImmutableList(),
|
blockedUsers = ignoredMatrixUser.toImmutableList(),
|
||||||
unblockUserAction = unblockUserAction.value,
|
unblockUserAction = unblockUserAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ class DeveloperSettingsPresenter(
|
||||||
computeCacheSize(cacheSize)
|
computeCacheSize(cacheSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: DeveloperSettingsEvents) {
|
fun handleEvent(event: DeveloperSettingsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is DeveloperSettingsEvents.UpdateEnabledFeature -> coroutineScope.updateEnabledFeature(
|
is DeveloperSettingsEvents.UpdateEnabledFeature -> coroutineScope.updateEnabledFeature(
|
||||||
enabledFeatures = enabledFeatures,
|
enabledFeatures = enabledFeatures,
|
||||||
|
|
@ -161,7 +161,7 @@ class DeveloperSettingsPresenter(
|
||||||
tracingLogPacks = tracingLogPacks,
|
tracingLogPacks = tracingLogPacks,
|
||||||
isEnterpriseBuild = enterpriseService.isEnterpriseBuild,
|
isEnterpriseBuild = enterpriseService.isEnterpriseBuild,
|
||||||
showColorPicker = showColorPicker,
|
showColorPicker = showColorPicker,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ class NotificationSettingsPresenter(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: NotificationSettingsEvents) {
|
fun handleEvent(event: NotificationSettingsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is NotificationSettingsEvents.SetAtRoomNotificationsEnabled -> {
|
is NotificationSettingsEvents.SetAtRoomNotificationsEnabled -> {
|
||||||
localCoroutineScope.setAtRoomNotificationsEnabled(event.enabled, changeNotificationSettingAction)
|
localCoroutineScope.setAtRoomNotificationsEnabled(event.enabled, changeNotificationSettingAction)
|
||||||
|
|
@ -167,7 +167,7 @@ class NotificationSettingsPresenter(
|
||||||
availablePushDistributors = availableDistributors,
|
availablePushDistributors = availableDistributors,
|
||||||
showChangePushProviderDialog = showChangePushProviderDialog,
|
showChangePushProviderDialog = showChangePushProviderDialog,
|
||||||
fullScreenIntentPermissionsState = key(refreshFullScreenIntentSettings) { fullScreenIntentPermissionsPresenter.present() },
|
fullScreenIntentPermissionsState = key(refreshFullScreenIntentSettings) { fullScreenIntentPermissionsPresenter.present() },
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class EditDefaultNotificationSettingPresenter(
|
||||||
displayMentionsOnlyDisclaimer = !notificationSettingsService.canHomeServerPushEncryptedEventsToDevice().getOrDefault(true)
|
displayMentionsOnlyDisclaimer = !notificationSettingsService.canHomeServerPushEncryptedEventsToDevice().getOrDefault(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: EditDefaultNotificationSettingStateEvents) {
|
fun handleEvent(event: EditDefaultNotificationSettingStateEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is EditDefaultNotificationSettingStateEvents.SetNotificationMode -> {
|
is EditDefaultNotificationSettingStateEvents.SetNotificationMode -> {
|
||||||
localCoroutineScope.setDefaultNotificationMode(event.mode, changeNotificationSettingAction)
|
localCoroutineScope.setDefaultNotificationMode(event.mode, changeNotificationSettingAction)
|
||||||
|
|
@ -85,7 +85,7 @@ class EditDefaultNotificationSettingPresenter(
|
||||||
roomsWithUserDefinedMode = roomsWithUserDefinedMode.value.toImmutableList(),
|
roomsWithUserDefinedMode = roomsWithUserDefinedMode.value.toImmutableList(),
|
||||||
changeNotificationSettingAction = changeNotificationSettingAction.value,
|
changeNotificationSettingAction = changeNotificationSettingAction.value,
|
||||||
displayMentionsOnlyDisclaimer = displayMentionsOnlyDisclaimer,
|
displayMentionsOnlyDisclaimer = displayMentionsOnlyDisclaimer,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ class EditUserProfilePresenter(
|
||||||
|
|
||||||
val saveAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val saveAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
fun handleEvents(event: EditUserProfileEvents) {
|
fun handleEvent(event: EditUserProfileEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is EditUserProfileEvents.Save -> localCoroutineScope.saveChanges(
|
is EditUserProfileEvents.Save -> localCoroutineScope.saveChanges(
|
||||||
name = userDisplayName,
|
name = userDisplayName,
|
||||||
|
|
@ -143,7 +143,7 @@ class EditUserProfilePresenter(
|
||||||
saveButtonEnabled = canSave && saveAction.value !is AsyncAction.Loading,
|
saveButtonEnabled = canSave && saveAction.value !is AsyncAction.Loading,
|
||||||
saveAction = saveAction.value,
|
saveAction = saveAction.value,
|
||||||
cameraPermissionState = cameraPermissionState,
|
cameraPermissionState = cameraPermissionState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class BugReportPresenter(
|
||||||
}
|
}
|
||||||
val uploadListener = BugReporterUploadListener(sendingProgress, sendingAction)
|
val uploadListener = BugReporterUploadListener(sendingProgress, sendingAction)
|
||||||
|
|
||||||
fun handleEvents(event: BugReportEvents) {
|
fun handleEvent(event: BugReportEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
BugReportEvents.SendBugReport -> {
|
BugReportEvents.SendBugReport -> {
|
||||||
if (formState.value.description.length < 10) {
|
if (formState.value.description.length < 10) {
|
||||||
|
|
@ -121,7 +121,7 @@ class BugReportPresenter(
|
||||||
sending = sendingAction.value,
|
sending = sendingAction.value,
|
||||||
formState = formState.value,
|
formState = formState.value,
|
||||||
screenshotUri = screenshotUri.value,
|
screenshotUri = screenshotUri.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class DefaultCrashDetectionPresenter(
|
||||||
}
|
}
|
||||||
}.collectAsState(false)
|
}.collectAsState(false)
|
||||||
|
|
||||||
fun handleEvents(event: CrashDetectionEvents) {
|
fun handleEvent(event: CrashDetectionEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
CrashDetectionEvents.ResetAllCrashData -> localCoroutineScope.resetAll()
|
CrashDetectionEvents.ResetAllCrashData -> localCoroutineScope.resetAll()
|
||||||
CrashDetectionEvents.ResetAppHasCrashed -> localCoroutineScope.resetAppHasCrashed()
|
CrashDetectionEvents.ResetAppHasCrashed -> localCoroutineScope.resetAppHasCrashed()
|
||||||
|
|
@ -57,7 +57,7 @@ class DefaultCrashDetectionPresenter(
|
||||||
return CrashDetectionState(
|
return CrashDetectionState(
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
crashDetected = crashDetected,
|
crashDetected = crashDetected,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class DefaultRageshakeDetectionPresenter(
|
||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RageshakeDetectionEvents) {
|
fun handleEvent(event: RageshakeDetectionEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
RageshakeDetectionEvents.Disable -> {
|
RageshakeDetectionEvents.Disable -> {
|
||||||
preferencesState.eventSink(RageshakePreferencesEvents.SetIsEnabled(false))
|
preferencesState.eventSink(RageshakePreferencesEvents.SetIsEnabled(false))
|
||||||
|
|
@ -67,7 +67,7 @@ class DefaultRageshakeDetectionPresenter(
|
||||||
takeScreenshot = takeScreenshot.value,
|
takeScreenshot = takeScreenshot.value,
|
||||||
showDialog = showDialog.value,
|
showDialog = showDialog.value,
|
||||||
preferenceState = preferencesState,
|
preferenceState = preferencesState,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class DefaultRageshakePreferencesPresenter(
|
||||||
rageshakeDataStore.sensitivity()
|
rageshakeDataStore.sensitivity()
|
||||||
}.collectAsState(initial = 0f)
|
}.collectAsState(initial = 0f)
|
||||||
|
|
||||||
fun handleEvents(event: RageshakePreferencesEvents) {
|
fun handleEvent(event: RageshakePreferencesEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RageshakePreferencesEvents.SetIsEnabled -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
is RageshakePreferencesEvents.SetIsEnabled -> localCoroutineScope.setIsEnabled(event.isEnabled)
|
||||||
is RageshakePreferencesEvents.SetSensitivity -> localCoroutineScope.setSensitivity(event.sensitivity)
|
is RageshakePreferencesEvents.SetSensitivity -> localCoroutineScope.setSensitivity(event.sensitivity)
|
||||||
|
|
@ -59,7 +59,7 @@ class DefaultRageshakePreferencesPresenter(
|
||||||
isEnabled = isEnabled,
|
isEnabled = isEnabled,
|
||||||
isSupported = isSupported.value,
|
isSupported = isSupported.value,
|
||||||
sensitivity = sensitivity,
|
sensitivity = sensitivity,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class ReportRoomPresenter(
|
||||||
|
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: ReportRoomEvents) {
|
fun handleEvent(event: ReportRoomEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ReportRoomEvents.Report -> coroutineScope.reportRoom(reason, leaveRoom, reportAction)
|
ReportRoomEvents.Report -> coroutineScope.reportRoom(reason, leaveRoom, reportAction)
|
||||||
ReportRoomEvents.ToggleLeaveRoom -> {
|
ReportRoomEvents.ToggleLeaveRoom -> {
|
||||||
|
|
@ -61,7 +61,7 @@ class ReportRoomPresenter(
|
||||||
reason = reason,
|
reason = reason,
|
||||||
leaveRoom = leaveRoom,
|
leaveRoom = leaveRoom,
|
||||||
reportAction = reportAction.value,
|
reportAction = reportAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class RoomAliasResolverPresenter(
|
||||||
resolveAlias(resolveState)
|
resolveAlias(resolveState)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RoomAliasResolverEvents) {
|
fun handleEvent(event: RoomAliasResolverEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
RoomAliasResolverEvents.Retry -> coroutineScope.resolveAlias(resolveState)
|
RoomAliasResolverEvents.Retry -> coroutineScope.resolveAlias(resolveState)
|
||||||
RoomAliasResolverEvents.DismissError -> resolveState.value = AsyncData.Uninitialized
|
RoomAliasResolverEvents.DismissError -> resolveState.value = AsyncData.Uninitialized
|
||||||
|
|
@ -54,7 +54,7 @@ class RoomAliasResolverPresenter(
|
||||||
return RoomAliasResolverState(
|
return RoomAliasResolverState(
|
||||||
roomAlias = roomAlias,
|
roomAlias = roomAlias,
|
||||||
resolveState = resolveState.value,
|
resolveState = resolveState.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ class RoomDetailsPresenter(
|
||||||
val snackbarDispatcher = LocalSnackbarDispatcher.current
|
val snackbarDispatcher = LocalSnackbarDispatcher.current
|
||||||
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()
|
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()
|
||||||
|
|
||||||
fun handleEvents(event: RoomDetailsEvent) {
|
fun handleEvent(event: RoomDetailsEvent) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomDetailsEvent.LeaveRoom -> {
|
is RoomDetailsEvent.LeaveRoom -> {
|
||||||
leaveRoomState.eventSink(LeaveRoomEvent.LeaveRoom(room.roomId, needsConfirmation = event.needsConfirmation))
|
leaveRoomState.eventSink(LeaveRoomEvent.LeaveRoom(room.roomId, needsConfirmation = event.needsConfirmation))
|
||||||
|
|
@ -204,7 +204,7 @@ class RoomDetailsPresenter(
|
||||||
canReportRoom = canReportRoom,
|
canReportRoom = canReportRoom,
|
||||||
isTombstoned = roomInfo.successorRoom != null,
|
isTombstoned = roomInfo.successorRoom != null,
|
||||||
showDebugInfo = isDeveloperModeEnabled,
|
showDebugInfo = isDeveloperModeEnabled,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ class RoomDetailsEditPresenter(
|
||||||
|
|
||||||
val saveAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val saveAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
fun handleEvents(event: RoomDetailsEditEvents) {
|
fun handleEvent(event: RoomDetailsEditEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomDetailsEditEvents.Save -> localCoroutineScope.saveChanges(
|
is RoomDetailsEditEvents.Save -> localCoroutineScope.saveChanges(
|
||||||
currentNameTrimmed = roomRawNameTrimmed,
|
currentNameTrimmed = roomRawNameTrimmed,
|
||||||
|
|
@ -191,7 +191,7 @@ class RoomDetailsEditPresenter(
|
||||||
saveButtonEnabled = saveButtonEnabled,
|
saveButtonEnabled = saveButtonEnabled,
|
||||||
saveAction = saveAction.value,
|
saveAction = saveAction.value,
|
||||||
cameraPermissionState = cameraPermissionState,
|
cameraPermissionState = cameraPermissionState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ class RoomMemberListPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RoomMemberListEvents) {
|
fun handleEvent(event: RoomMemberListEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomMemberListEvents.OnSearchActiveChanged -> isSearchActive = event.active
|
is RoomMemberListEvents.OnSearchActiveChanged -> isSearchActive = event.active
|
||||||
is RoomMemberListEvents.UpdateSearchQuery -> searchQuery = event.query
|
is RoomMemberListEvents.UpdateSearchQuery -> searchQuery = event.query
|
||||||
|
|
@ -179,7 +179,7 @@ class RoomMemberListPresenter(
|
||||||
isSearchActive = isSearchActive,
|
isSearchActive = isSearchActive,
|
||||||
canInvite = canInvite,
|
canInvite = canInvite,
|
||||||
moderationState = roomModerationState,
|
moderationState = roomModerationState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ class RoomNotificationSettingsPresenter(
|
||||||
!notificationSettingsService.canHomeServerPushEncryptedEventsToDevice().getOrDefault(true)
|
!notificationSettingsService.canHomeServerPushEncryptedEventsToDevice().getOrDefault(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RoomNotificationSettingsEvents) {
|
fun handleEvent(event: RoomNotificationSettingsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomNotificationSettingsEvents.ChangeRoomNotificationMode -> {
|
is RoomNotificationSettingsEvents.ChangeRoomNotificationMode -> {
|
||||||
localCoroutineScope.setRoomNotificationMode(event.mode, pendingRoomNotificationMode, pendingSetDefault, setNotificationSettingAction)
|
localCoroutineScope.setRoomNotificationMode(event.mode, pendingRoomNotificationMode, pendingSetDefault, setNotificationSettingAction)
|
||||||
|
|
@ -135,7 +135,7 @@ class RoomNotificationSettingsPresenter(
|
||||||
setNotificationSettingAction = setNotificationSettingAction.value,
|
setNotificationSettingAction = setNotificationSettingAction.value,
|
||||||
restoreDefaultAction = restoreDefaultAction.value,
|
restoreDefaultAction = restoreDefaultAction.value,
|
||||||
displayMentionsOnlyDisclaimer = shouldDisplayMentionsOnlyDisclaimer,
|
displayMentionsOnlyDisclaimer = shouldDisplayMentionsOnlyDisclaimer,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class SecurityAndPrivacyPresenter(
|
||||||
var showEnableEncryptionConfirmation by remember(savedSettings.isEncrypted) { mutableStateOf(false) }
|
var showEnableEncryptionConfirmation by remember(savedSettings.isEncrypted) { mutableStateOf(false) }
|
||||||
val permissions by room.securityAndPrivacyPermissionsAsState(syncUpdateFlow.value)
|
val permissions by room.securityAndPrivacyPermissionsAsState(syncUpdateFlow.value)
|
||||||
|
|
||||||
fun handleEvents(event: SecurityAndPrivacyEvents) {
|
fun handleEvent(event: SecurityAndPrivacyEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SecurityAndPrivacyEvents.Save -> {
|
SecurityAndPrivacyEvents.Save -> {
|
||||||
coroutineScope.save(
|
coroutineScope.save(
|
||||||
|
|
@ -158,7 +158,7 @@ class SecurityAndPrivacyPresenter(
|
||||||
isKnockEnabled = isKnockEnabled,
|
isKnockEnabled = isKnockEnabled,
|
||||||
saveAction = saveAction.value,
|
saveAction = saveAction.value,
|
||||||
permissions = permissions,
|
permissions = permissions,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
|
|
||||||
// If the history visibility is not available for the current access, use the fallback.
|
// If the history visibility is not available for the current access, use the fallback.
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class EditRoomAddressPresenter(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: EditRoomAddressEvents) {
|
fun handleEvent(event: EditRoomAddressEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
EditRoomAddressEvents.Save -> coroutineScope.save(
|
EditRoomAddressEvents.Save -> coroutineScope.save(
|
||||||
saveAction = saveAction,
|
saveAction = saveAction,
|
||||||
|
|
@ -92,7 +92,7 @@ class EditRoomAddressPresenter(
|
||||||
roomAddressValidity = roomAddressValidity.value,
|
roomAddressValidity = roomAddressValidity.value,
|
||||||
roomAddress = newRoomAddress,
|
roomAddress = newRoomAddress,
|
||||||
saveAction = saveAction.value,
|
saveAction = saveAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class RoomDirectoryPresenter(
|
||||||
loadingMore = false
|
loadingMore = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun handleEvents(event: RoomDirectoryEvents) {
|
fun handleEvent(event: RoomDirectoryEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
RoomDirectoryEvents.LoadMore -> {
|
RoomDirectoryEvents.LoadMore -> {
|
||||||
loadingMore = true
|
loadingMore = true
|
||||||
|
|
@ -77,7 +77,7 @@ class RoomDirectoryPresenter(
|
||||||
query = searchQuery.orEmpty(),
|
query = searchQuery.orEmpty(),
|
||||||
roomDescriptions = listState.items,
|
roomDescriptions = listState.items,
|
||||||
displayLoadMoreIndicator = listState.hasMoreToLoad,
|
displayLoadMoreIndicator = listState.hasMoreToLoad,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class SecureBackupDisablePresenter(
|
||||||
Timber.tag(loggerTagDisable.value).d("backupState: $backupState")
|
Timber.tag(loggerTagDisable.value).d("backupState: $backupState")
|
||||||
val disableAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val disableAction: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
fun handleEvents(event: SecureBackupDisableEvents) {
|
fun handleEvent(event: SecureBackupDisableEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is SecureBackupDisableEvents.DisableBackup -> coroutineScope.disableBackup(disableAction)
|
is SecureBackupDisableEvents.DisableBackup -> coroutineScope.disableBackup(disableAction)
|
||||||
SecureBackupDisableEvents.DismissDialogs -> {
|
SecureBackupDisableEvents.DismissDialogs -> {
|
||||||
|
|
@ -49,7 +49,7 @@ class SecureBackupDisablePresenter(
|
||||||
backupState = backupState,
|
backupState = backupState,
|
||||||
disableAction = disableAction.value,
|
disableAction = disableAction.value,
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class SecureBackupEnterRecoveryKeyPresenter(
|
||||||
mutableStateOf(AsyncAction.Uninitialized)
|
mutableStateOf(AsyncAction.Uninitialized)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: SecureBackupEnterRecoveryKeyEvents) {
|
fun handleEvent(event: SecureBackupEnterRecoveryKeyEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SecureBackupEnterRecoveryKeyEvents.ClearDialog -> {
|
SecureBackupEnterRecoveryKeyEvents.ClearDialog -> {
|
||||||
submitAction.value = AsyncAction.Uninitialized
|
submitAction.value = AsyncAction.Uninitialized
|
||||||
|
|
@ -78,7 +78,7 @@ class SecureBackupEnterRecoveryKeyPresenter(
|
||||||
),
|
),
|
||||||
isSubmitEnabled = recoveryKey.isNotEmpty() && submitAction.value.isUninitialized(),
|
isSubmitEnabled = recoveryKey.isNotEmpty() && submitAction.value.isUninitialized(),
|
||||||
submitAction = submitAction.value,
|
submitAction = submitAction.value,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class ResetIdentityPasswordPresenter(
|
||||||
|
|
||||||
return ResetIdentityPasswordState(
|
return ResetIdentityPasswordState(
|
||||||
resetAction = resetAction.value,
|
resetAction = resetAction.value,
|
||||||
eventSink = ::handleEvent
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class ResetIdentityRootPresenter : Presenter<ResetIdentityRootState> {
|
||||||
|
|
||||||
return ResetIdentityRootState(
|
return ResetIdentityRootState(
|
||||||
displayConfirmationDialog = displayConfirmDialog,
|
displayConfirmationDialog = displayConfirmDialog,
|
||||||
eventSink = ::handleEvent
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class SecureBackupRootPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: SecureBackupRootEvents) {
|
fun handleEvent(event: SecureBackupRootEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SecureBackupRootEvents.RetryKeyBackupState -> localCoroutineScope.getKeyBackupStatus(doesBackupExistOnServerAction)
|
SecureBackupRootEvents.RetryKeyBackupState -> localCoroutineScope.getKeyBackupStatus(doesBackupExistOnServerAction)
|
||||||
SecureBackupRootEvents.EnableKeyStorage -> localCoroutineScope.enableBackup(enableAction)
|
SecureBackupRootEvents.EnableKeyStorage -> localCoroutineScope.enableBackup(enableAction)
|
||||||
|
|
@ -78,7 +78,7 @@ class SecureBackupRootPresenter(
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
displayKeyStorageDisabledError = displayKeyStorageDisabledError,
|
displayKeyStorageDisabledError = displayKeyStorageDisabledError,
|
||||||
snackbarMessage = snackbarMessage,
|
snackbarMessage = snackbarMessage,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class SecureBackupSetupPresenter(
|
||||||
}
|
}
|
||||||
var showSaveConfirmationDialog by remember { mutableStateOf(false) }
|
var showSaveConfirmationDialog by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
fun handleEvents(event: SecureBackupSetupEvents) {
|
fun handleEvent(event: SecureBackupSetupEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SecureBackupSetupEvents.CreateRecoveryKey -> {
|
SecureBackupSetupEvents.CreateRecoveryKey -> {
|
||||||
coroutineScope.createOrChangeRecoveryKey(stateAndDispatch)
|
coroutineScope.createOrChangeRecoveryKey(stateAndDispatch)
|
||||||
|
|
@ -81,7 +81,7 @@ class SecureBackupSetupPresenter(
|
||||||
recoveryKeyViewState = recoveryKeyViewState,
|
recoveryKeyViewState = recoveryKeyViewState,
|
||||||
setupState = setupState,
|
setupState = setupState,
|
||||||
showSaveConfirmationDialog = showSaveConfirmationDialog,
|
showSaveConfirmationDialog = showSaveConfirmationDialog,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class SharePresenter(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): ShareState {
|
override fun present(): ShareState {
|
||||||
fun handleEvents(event: ShareEvents) {
|
fun handleEvent(event: ShareEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
ShareEvents.ClearError -> shareActionState.value = AsyncAction.Uninitialized
|
ShareEvents.ClearError -> shareActionState.value = AsyncAction.Uninitialized
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ class SharePresenter(
|
||||||
|
|
||||||
return ShareState(
|
return ShareState(
|
||||||
shareAction = shareActionState.value,
|
shareAction = shareActionState.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class SignedOutPresenter(
|
||||||
}.collectAsState(initial = null)
|
}.collectAsState(initial = null)
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
fun handleEvents(event: SignedOutEvents) {
|
fun handleEvent(event: SignedOutEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SignedOutEvents.SignInAgain -> coroutineScope.launch {
|
SignedOutEvents.SignInAgain -> coroutineScope.launch {
|
||||||
sessionStore.removeSession(sessionId.value)
|
sessionStore.removeSession(sessionId.value)
|
||||||
|
|
@ -53,7 +53,7 @@ class SignedOutPresenter(
|
||||||
return SignedOutState(
|
return SignedOutState(
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
signedOutSession = signedOutSession,
|
signedOutSession = signedOutSession,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ class LeaveSpacePresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: LeaveSpaceEvents) {
|
fun handleEvent(event: LeaveSpaceEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
LeaveSpaceEvents.Retry -> {
|
LeaveSpaceEvents.Retry -> {
|
||||||
leaveSpaceRooms = AsyncData.Loading()
|
leaveSpaceRooms = AsyncData.Loading()
|
||||||
|
|
@ -134,7 +134,7 @@ class LeaveSpacePresenter(
|
||||||
isLastAdmin = leaveSpaceRooms.dataOrNull()?.current?.isLastAdmin == true,
|
isLastAdmin = leaveSpaceRooms.dataOrNull()?.current?.isLastAdmin == true,
|
||||||
selectableSpaceRooms = selectableSpaceRooms,
|
selectableSpaceRooms = selectableSpaceRooms,
|
||||||
leaveSpaceAction = leaveSpaceAction.value,
|
leaveSpaceAction = leaveSpaceAction.value,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class SpacePresenter(
|
||||||
|
|
||||||
val acceptDeclineInviteState = acceptDeclineInvitePresenter.present()
|
val acceptDeclineInviteState = acceptDeclineInvitePresenter.present()
|
||||||
|
|
||||||
fun handleEvents(event: SpaceEvents) {
|
fun handleEvent(event: SpaceEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
SpaceEvents.LoadMore -> localCoroutineScope.paginate()
|
SpaceEvents.LoadMore -> localCoroutineScope.paginate()
|
||||||
is SpaceEvents.Join -> {
|
is SpaceEvents.Join -> {
|
||||||
|
|
@ -128,7 +128,7 @@ class SpacePresenter(
|
||||||
joinActions = joinActions.toImmutableMap(),
|
joinActions = joinActions.toImmutableMap(),
|
||||||
acceptDeclineInviteState = acceptDeclineInviteState,
|
acceptDeclineInviteState = acceptDeclineInviteState,
|
||||||
topicViewerState = topicViewerState,
|
topicViewerState = topicViewerState,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class JoinRoomByAddressPresenter(
|
||||||
var internalAddressState by remember { mutableStateOf<RoomAddressState>(RoomAddressState.Unknown) }
|
var internalAddressState by remember { mutableStateOf<RoomAddressState>(RoomAddressState.Unknown) }
|
||||||
var validateAddress: Boolean by remember { mutableStateOf(false) }
|
var validateAddress: Boolean by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
fun handleEvents(event: JoinRoomByAddressEvents) {
|
fun handleEvent(event: JoinRoomByAddressEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
JoinRoomByAddressEvents.Continue -> {
|
JoinRoomByAddressEvents.Continue -> {
|
||||||
when (val currentState = internalAddressState) {
|
when (val currentState = internalAddressState) {
|
||||||
|
|
@ -88,7 +88,7 @@ class JoinRoomByAddressPresenter(
|
||||||
return JoinRoomByAddressState(
|
return JoinRoomByAddressState(
|
||||||
address = address,
|
address = address,
|
||||||
addressState = addressState,
|
addressState = addressState,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class StartChatPresenter(
|
||||||
featureFlagService.isFeatureEnabledFlow(FeatureFlags.RoomDirectorySearch)
|
featureFlagService.isFeatureEnabledFlow(FeatureFlags.RoomDirectorySearch)
|
||||||
}.collectAsState(initial = false)
|
}.collectAsState(initial = false)
|
||||||
|
|
||||||
fun handleEvents(event: StartChatEvents) {
|
fun handleEvent(event: StartChatEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is StartChatEvents.StartDM -> localCoroutineScope.launch {
|
is StartChatEvents.StartDM -> localCoroutineScope.launch {
|
||||||
startDMAction.execute(
|
startDMAction.execute(
|
||||||
|
|
@ -75,7 +75,7 @@ class StartChatPresenter(
|
||||||
userListState = userListState,
|
userListState = userListState,
|
||||||
startDmAction = startDmActionState.value,
|
startDmAction = startDmActionState.value,
|
||||||
isRoomDirectorySearchEnabled = isRoomDirectorySearchEnabled,
|
isRoomDirectorySearchEnabled = isRoomDirectorySearchEnabled,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ class UserProfilePresenter(
|
||||||
}
|
}
|
||||||
val userProfile by produceState<MatrixUser?>(null) { value = client.getProfile(userId).getOrNull() }
|
val userProfile by produceState<MatrixUser?>(null) { value = client.getProfile(userId).getOrNull() }
|
||||||
|
|
||||||
fun handleEvents(event: UserProfileEvents) {
|
fun handleEvent(event: UserProfileEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is UserProfileEvents.BlockUser -> {
|
is UserProfileEvents.BlockUser -> {
|
||||||
if (event.needsConfirmation) {
|
if (event.needsConfirmation) {
|
||||||
|
|
@ -151,7 +151,7 @@ class UserProfilePresenter(
|
||||||
dmRoomId = dmRoomId,
|
dmRoomId = dmRoomId,
|
||||||
canCall = canCall,
|
canCall = canCall,
|
||||||
snackbarMessage = null,
|
snackbarMessage = null,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class IncomingVerificationPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: IncomingVerificationViewEvents) {
|
fun handleEvent(event: IncomingVerificationViewEvents) {
|
||||||
Timber.d("Verification user action: ${event::class.simpleName}")
|
Timber.d("Verification user action: ${event::class.simpleName}")
|
||||||
when (event) {
|
when (event) {
|
||||||
IncomingVerificationViewEvents.StartVerification ->
|
IncomingVerificationViewEvents.StartVerification ->
|
||||||
|
|
@ -141,7 +141,7 @@ class IncomingVerificationPresenter(
|
||||||
return IncomingVerificationState(
|
return IncomingVerificationState(
|
||||||
step = step,
|
step = step,
|
||||||
request = verificationRequest,
|
request = verificationRequest,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class OutgoingVerificationPresenter(
|
||||||
observeVerificationService()
|
observeVerificationService()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: OutgoingVerificationViewEvents) {
|
fun handleEvent(event: OutgoingVerificationViewEvents) {
|
||||||
Timber.d("Verification user action: ${event::class.simpleName}")
|
Timber.d("Verification user action: ${event::class.simpleName}")
|
||||||
when (event) {
|
when (event) {
|
||||||
// Just relay the event to the state machine
|
// Just relay the event to the state machine
|
||||||
|
|
@ -109,7 +109,7 @@ class OutgoingVerificationPresenter(
|
||||||
return OutgoingVerificationState(
|
return OutgoingVerificationState(
|
||||||
step = step,
|
step = step,
|
||||||
request = verificationRequest,
|
request = verificationRequest,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class FullScreenIntentPermissionsPresenter(
|
||||||
val isGranted = notificationManagerCompat.canUseFullScreenIntent()
|
val isGranted = notificationManagerCompat.canUseFullScreenIntent()
|
||||||
val isBannerDismissed by isFullScreenIntentBannerDismissed.collectAsState(initial = true)
|
val isBannerDismissed by isFullScreenIntentBannerDismissed.collectAsState(initial = true)
|
||||||
|
|
||||||
fun handleEvents(event: FullScreenIntentPermissionsEvents) {
|
fun handleEvent(event: FullScreenIntentPermissionsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
FullScreenIntentPermissionsEvents.Dismiss -> coroutineScope.launch {
|
FullScreenIntentPermissionsEvents.Dismiss -> coroutineScope.launch {
|
||||||
dismissFullScreenIntentBanner()
|
dismissFullScreenIntentBanner()
|
||||||
|
|
@ -75,7 +75,7 @@ class FullScreenIntentPermissionsPresenter(
|
||||||
return FullScreenIntentPermissionsState(
|
return FullScreenIntentPermissionsState(
|
||||||
permissionGranted = isGranted,
|
permissionGranted = isGranted,
|
||||||
shouldDisplayBanner = !isBannerDismissed && !isGranted,
|
shouldDisplayBanner = !isBannerDismissed && !isGranted,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class MediaGalleryPresenter(
|
||||||
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()
|
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()
|
||||||
localMediaActions.Configure()
|
localMediaActions.Configure()
|
||||||
|
|
||||||
fun handleEvents(event: MediaGalleryEvents) {
|
fun handleEvent(event: MediaGalleryEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is MediaGalleryEvents.ChangeMode -> {
|
is MediaGalleryEvents.ChangeMode -> {
|
||||||
mode = event.mode
|
mode = event.mode
|
||||||
|
|
@ -150,7 +150,7 @@ class MediaGalleryPresenter(
|
||||||
groupedMediaItems = groupedMediaItems,
|
groupedMediaItems = groupedMediaItems,
|
||||||
mediaBottomSheetState = mediaBottomSheetState,
|
mediaBottomSheetState = mediaBottomSheetState,
|
||||||
snackbarMessage = snackbarMessage,
|
snackbarMessage = snackbarMessage,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ class MediaViewerPresenter(
|
||||||
}
|
}
|
||||||
localMediaActions.Configure()
|
localMediaActions.Configure()
|
||||||
|
|
||||||
fun handleEvents(event: MediaViewerEvents) {
|
fun handleEvent(event: MediaViewerEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is MediaViewerEvents.LoadMedia -> {
|
is MediaViewerEvents.LoadMedia -> {
|
||||||
coroutineScope.downloadMedia(data = event.data)
|
coroutineScope.downloadMedia(data = event.data)
|
||||||
|
|
@ -163,7 +163,7 @@ class MediaViewerPresenter(
|
||||||
snackbarMessage = snackbarMessage,
|
snackbarMessage = snackbarMessage,
|
||||||
canShowInfo = inputs.canShowInfo,
|
canShowInfo = inputs.canShowInfo,
|
||||||
mediaBottomSheetState = mediaBottomSheetState,
|
mediaBottomSheetState = mediaBottomSheetState,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ class DefaultPermissionsPresenter(
|
||||||
|
|
||||||
val showDialog = rememberSaveable { mutableStateOf(false) }
|
val showDialog = rememberSaveable { mutableStateOf(false) }
|
||||||
|
|
||||||
fun handleEvents(event: PermissionsEvents) {
|
fun handleEvent(event: PermissionsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
PermissionsEvents.CloseDialog -> {
|
PermissionsEvents.CloseDialog -> {
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
|
|
@ -125,7 +125,7 @@ class DefaultPermissionsPresenter(
|
||||||
showDialog = showDialog.value,
|
showDialog = showDialog.value,
|
||||||
permissionAlreadyAsked = isAlreadyAsked,
|
permissionAlreadyAsked = isAlreadyAsked,
|
||||||
permissionAlreadyDenied = isAlreadyDenied,
|
permissionAlreadyDenied = isAlreadyDenied,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class BatteryOptimizationPresenter(
|
||||||
onPauseOrDispose {}
|
onPauseOrDispose {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: BatteryOptimizationEvents) {
|
fun handleEvent(event: BatteryOptimizationEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
BatteryOptimizationEvents.Dismiss -> coroutineScope.launch {
|
BatteryOptimizationEvents.Dismiss -> coroutineScope.launch {
|
||||||
mutableBatteryOptimizationStore.onOptimizationBannerDismissed()
|
mutableBatteryOptimizationStore.onOptimizationBannerDismissed()
|
||||||
|
|
@ -66,7 +66,7 @@ class BatteryOptimizationPresenter(
|
||||||
|
|
||||||
return BatteryOptimizationState(
|
return BatteryOptimizationState(
|
||||||
shouldDisplayBanner = localShouldDisplayBanner && storeShouldDisplayBanner && !isSystemIgnoringBatteryOptimizations,
|
shouldDisplayBanner = localShouldDisplayBanner && storeShouldDisplayBanner && !isSystemIgnoringBatteryOptimizations,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class RoomSelectPresenter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvents(event: RoomSelectEvents) {
|
fun handleEvent(event: RoomSelectEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is RoomSelectEvents.SetSelectedRoom -> {
|
is RoomSelectEvents.SetSelectedRoom -> {
|
||||||
selectedRooms = persistentListOf(event.room)
|
selectedRooms = persistentListOf(event.room)
|
||||||
|
|
@ -87,7 +87,7 @@ class RoomSelectPresenter(
|
||||||
query = searchQuery,
|
query = searchQuery,
|
||||||
isSearchActive = isSearchActive,
|
isSearchActive = isSearchActive,
|
||||||
selectedRooms = selectedRooms,
|
selectedRooms = selectedRooms,
|
||||||
eventSink = ::handleEvents,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class TroubleshootNotificationsPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
val testSuiteState by troubleshootTestSuite.state.collectAsState()
|
val testSuiteState by troubleshootTestSuite.state.collectAsState()
|
||||||
fun handleEvents(event: TroubleshootNotificationsEvents) {
|
fun handleEvent(event: TroubleshootNotificationsEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
TroubleshootNotificationsEvents.StartTests -> coroutineScope.launch {
|
TroubleshootNotificationsEvents.StartTests -> coroutineScope.launch {
|
||||||
troubleshootTestSuite.runTestSuite(this)
|
troubleshootTestSuite.runTestSuite(this)
|
||||||
|
|
@ -57,7 +57,7 @@ class TroubleshootNotificationsPresenter(
|
||||||
|
|
||||||
return TroubleshootNotificationsState(
|
return TroubleshootNotificationsState(
|
||||||
testSuiteState = testSuiteState,
|
testSuiteState = testSuiteState,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class PushHistoryPresenter(
|
||||||
var resetAction: AsyncAction<Unit> by remember { mutableStateOf(AsyncAction.Uninitialized) }
|
var resetAction: AsyncAction<Unit> by remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
var showNotSameAccountError by remember { mutableStateOf(false) }
|
var showNotSameAccountError by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
fun handleEvents(event: PushHistoryEvents) {
|
fun handleEvent(event: PushHistoryEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is PushHistoryEvents.SetShowOnlyErrors -> {
|
is PushHistoryEvents.SetShowOnlyErrors -> {
|
||||||
showOnlyErrors = event.showOnlyErrors
|
showOnlyErrors = event.showOnlyErrors
|
||||||
|
|
@ -97,7 +97,7 @@ class PushHistoryPresenter(
|
||||||
showOnlyErrors = showOnlyErrors,
|
showOnlyErrors = showOnlyErrors,
|
||||||
resetAction = resetAction,
|
resetAction = resetAction,
|
||||||
showNotSameAccountError = showNotSameAccountError,
|
showNotSameAccountError = showNotSameAccountError,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue