Rename fun in Callback for clarity.
This commit is contained in:
committed by
Benoit Marty
parent
45b5783b23
commit
09a18ad7ca
@@ -56,8 +56,8 @@ class LoggedInAppScopeFlowNode(
|
||||
plugins = plugins
|
||||
), DependencyInjectionGraphOwner {
|
||||
interface Callback : Plugin {
|
||||
fun onOpenBugReport()
|
||||
fun onAddAccount()
|
||||
fun navigateToBugReport()
|
||||
fun navigateToAddAccount()
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
@@ -81,12 +81,12 @@ class LoggedInAppScopeFlowNode(
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
val callback = object : LoggedInFlowNode.Callback {
|
||||
override fun onOpenBugReport() {
|
||||
plugins<Callback>().forEach { it.onOpenBugReport() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
override fun onAddAccount() {
|
||||
plugins<Callback>().forEach { it.onAddAccount() }
|
||||
override fun navigateToAddAccount() {
|
||||
plugins<Callback>().forEach { it.navigateToAddAccount() }
|
||||
}
|
||||
}
|
||||
return createNode<LoggedInFlowNode>(buildContext, listOf(callback))
|
||||
|
||||
@@ -148,8 +148,8 @@ class LoggedInFlowNode(
|
||||
plugins = plugins
|
||||
) {
|
||||
interface Callback : Plugin {
|
||||
fun onOpenBugReport()
|
||||
fun onAddAccount()
|
||||
fun navigateToBugReport()
|
||||
fun navigateToAddAccount()
|
||||
}
|
||||
|
||||
private val loggedInFlowProcessor = LoggedInEventProcessor(
|
||||
@@ -282,7 +282,7 @@ class LoggedInFlowNode(
|
||||
data object Ftue : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data object RoomDirectorySearch : NavTarget
|
||||
data object RoomDirectory : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class IncomingShare(val intent: Intent) : NavTarget
|
||||
@@ -304,32 +304,32 @@ class LoggedInFlowNode(
|
||||
}
|
||||
NavTarget.Home -> {
|
||||
val callback = object : HomeEntryPoint.Callback {
|
||||
override fun onRoomClick(roomId: RoomId) {
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias()))
|
||||
}
|
||||
|
||||
override fun onSettingsClick() {
|
||||
override fun navigateToSettings() {
|
||||
backstack.push(NavTarget.Settings())
|
||||
}
|
||||
|
||||
override fun onStartChatClick() {
|
||||
override fun navigateToCreateRoom() {
|
||||
backstack.push(NavTarget.CreateRoom)
|
||||
}
|
||||
|
||||
override fun onSetUpRecoveryClick() {
|
||||
override fun navigateToSetUpRecovery() {
|
||||
backstack.push(NavTarget.SecureBackup(initialElement = SecureBackupEntryPoint.InitialTarget.Root))
|
||||
}
|
||||
|
||||
override fun onSessionConfirmRecoveryKeyClick() {
|
||||
override fun navigateToEnterRecoveryKey() {
|
||||
backstack.push(NavTarget.SecureBackup(initialElement = SecureBackupEntryPoint.InitialTarget.EnterRecoveryKey))
|
||||
}
|
||||
|
||||
override fun onRoomSettingsClick(roomId: RoomId) {
|
||||
override fun navigateToRoomSettings(roomId: RoomId) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias(), initialElement = RoomNavigationTarget.Details))
|
||||
}
|
||||
|
||||
override fun onReportBugClick() {
|
||||
plugins<Callback>().forEach { it.onOpenBugReport() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
}
|
||||
homeEntryPoint
|
||||
@@ -339,11 +339,11 @@ class LoggedInFlowNode(
|
||||
}
|
||||
is NavTarget.Room -> {
|
||||
val joinedRoomCallback = object : JoinedRoomLoadedFlowNode.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId, serverNames: List<String>) {
|
||||
override fun navigateToRoom(roomId: RoomId, serverNames: List<String>) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias(), serverNames))
|
||||
}
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
when (data) {
|
||||
is PermalinkData.UserLink -> {
|
||||
// Should not happen (handled by MessagesNode)
|
||||
@@ -369,7 +369,7 @@ class LoggedInFlowNode(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onOpenGlobalNotificationSettings() {
|
||||
override fun navigateToGlobalNotificationSettings() {
|
||||
backstack.push(NavTarget.Settings(PreferencesEntryPoint.InitialTarget.NotificationSettings))
|
||||
}
|
||||
}
|
||||
@@ -384,7 +384,7 @@ class LoggedInFlowNode(
|
||||
}
|
||||
is NavTarget.UserProfile -> {
|
||||
val callback = object : UserProfileEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId) {
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias()))
|
||||
}
|
||||
}
|
||||
@@ -395,23 +395,23 @@ class LoggedInFlowNode(
|
||||
}
|
||||
is NavTarget.Settings -> {
|
||||
val callback = object : PreferencesEntryPoint.Callback {
|
||||
override fun onAddAccount() {
|
||||
plugins<Callback>().forEach { it.onAddAccount() }
|
||||
override fun navigateToAddAccount() {
|
||||
plugins<Callback>().forEach { it.navigateToAddAccount() }
|
||||
}
|
||||
|
||||
override fun onOpenBugReport() {
|
||||
plugins<Callback>().forEach { it.onOpenBugReport() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
override fun onSecureBackupClick() {
|
||||
override fun navigateToSecureBackup() {
|
||||
backstack.push(NavTarget.SecureBackup())
|
||||
}
|
||||
|
||||
override fun onOpenRoomNotificationSettings(roomId: RoomId) {
|
||||
override fun navigateToRoomNotificationSettings(roomId: RoomId) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias(), initialElement = RoomNavigationTarget.NotificationSettings))
|
||||
}
|
||||
|
||||
override fun navigateTo(roomId: RoomId, eventId: EventId) {
|
||||
override fun navigateToEvent(roomId: RoomId, eventId: EventId) {
|
||||
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias(), initialElement = RoomNavigationTarget.Root(eventId)))
|
||||
}
|
||||
}
|
||||
@@ -423,12 +423,12 @@ class LoggedInFlowNode(
|
||||
}
|
||||
NavTarget.CreateRoom -> {
|
||||
val callback = object : StartChatEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) {
|
||||
override fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) {
|
||||
backstack.replace(NavTarget.Room(roomIdOrAlias = roomIdOrAlias, serverNames = serverNames))
|
||||
}
|
||||
|
||||
override fun onOpenRoomDirectory() {
|
||||
backstack.push(NavTarget.RoomDirectorySearch)
|
||||
override fun navigateToRoomDirectory() {
|
||||
backstack.push(NavTarget.RoomDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,10 +450,10 @@ class LoggedInFlowNode(
|
||||
NavTarget.Ftue -> {
|
||||
ftueEntryPoint.createNode(this, buildContext)
|
||||
}
|
||||
NavTarget.RoomDirectorySearch -> {
|
||||
NavTarget.RoomDirectory -> {
|
||||
roomDirectoryEntryPoint.nodeBuilder(this, buildContext)
|
||||
.callback(object : RoomDirectoryEntryPoint.Callback {
|
||||
override fun onResultClick(roomDescription: RoomDescription) {
|
||||
override fun navigateToRoom(roomDescription: RoomDescription) {
|
||||
backstack.push(
|
||||
NavTarget.Room(
|
||||
roomIdOrAlias = roomDescription.roomId.toRoomIdOrAlias(),
|
||||
|
||||
@@ -55,7 +55,7 @@ class NotLoggedInFlowNode(
|
||||
) : NodeInputs
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenBugReport()
|
||||
fun navigateToBugReport()
|
||||
}
|
||||
|
||||
private val inputs = inputs<Params>()
|
||||
@@ -78,8 +78,8 @@ class NotLoggedInFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.Root -> {
|
||||
val callback = object : LoginEntryPoint.Callback {
|
||||
override fun onReportProblem() {
|
||||
plugins<Callback>().forEach { it.onOpenBugReport() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
}
|
||||
loginEntryPoint
|
||||
|
||||
@@ -227,11 +227,11 @@ class RootFlowNode(
|
||||
}
|
||||
val inputs = LoggedInAppScopeFlowNode.Inputs(matrixClient)
|
||||
val callback = object : LoggedInAppScopeFlowNode.Callback {
|
||||
override fun onOpenBugReport() {
|
||||
override fun navigateToBugReport() {
|
||||
backstack.push(NavTarget.BugReport)
|
||||
}
|
||||
|
||||
override fun onAddAccount() {
|
||||
override fun navigateToAddAccount() {
|
||||
backstack.push(NavTarget.NotLoggedInFlow(null))
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class RootFlowNode(
|
||||
}
|
||||
is NavTarget.NotLoggedInFlow -> {
|
||||
val callback = object : NotLoggedInFlowNode.Callback {
|
||||
override fun onOpenBugReport() {
|
||||
override fun navigateToBugReport() {
|
||||
backstack.push(NavTarget.BugReport)
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ class RootFlowNode(
|
||||
}
|
||||
is NavTarget.AccountSelect -> {
|
||||
val callback: AccountSelectEntryPoint.Callback = object : AccountSelectEntryPoint.Callback {
|
||||
override fun onSelectAccount(sessionId: SessionId) {
|
||||
override fun onAccountSelected(sessionId: SessionId) {
|
||||
lifecycleScope.launch {
|
||||
if (sessionId == navTarget.currentSessionId) {
|
||||
// Ensure that the account selection Node is removed from the backstack
|
||||
|
||||
@@ -76,9 +76,9 @@ class JoinedRoomLoadedFlowNode(
|
||||
plugins = plugins,
|
||||
), DependencyInjectionGraphOwner {
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomId: RoomId, serverNames: List<String>)
|
||||
fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun onOpenGlobalNotificationSettings()
|
||||
fun navigateToRoom(roomId: RoomId, serverNames: List<String>)
|
||||
fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun navigateToGlobalNotificationSettings()
|
||||
}
|
||||
|
||||
data class Inputs(
|
||||
@@ -123,19 +123,19 @@ class JoinedRoomLoadedFlowNode(
|
||||
|
||||
private fun createRoomDetailsNode(buildContext: BuildContext, initialTarget: RoomDetailsEntryPoint.InitialTarget): Node {
|
||||
val callback = object : RoomDetailsEntryPoint.Callback {
|
||||
override fun onOpenGlobalNotificationSettings() {
|
||||
callbacks.forEach { it.onOpenGlobalNotificationSettings() }
|
||||
override fun navigateToGlobalNotificationSettings() {
|
||||
callbacks.forEach { it.navigateToGlobalNotificationSettings() }
|
||||
}
|
||||
|
||||
override fun onOpenRoom(roomId: RoomId, serverNames: List<String>) {
|
||||
callbacks.forEach { it.onOpenRoom(roomId, serverNames) }
|
||||
override fun navigateToRoom(roomId: RoomId, serverNames: List<String>) {
|
||||
callbacks.forEach { it.navigateToRoom(roomId, serverNames) }
|
||||
}
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
callbacks.forEach { it.onPermalinkClick(data, pushToBackstack) }
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
callbacks.forEach { it.handlePermalinkClick(data, pushToBackstack) }
|
||||
}
|
||||
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
override fun startForwardEventFlow(eventId: EventId) {
|
||||
backstack.push(NavTarget.ForwardEvent(eventId))
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class JoinedRoomLoadedFlowNode(
|
||||
override fun onDone(roomIds: List<RoomId>) {
|
||||
backstack.pop()
|
||||
roomIds.singleOrNull()?.let { roomId ->
|
||||
callbacks.forEach { it.onOpenRoom(roomId, emptyList()) }
|
||||
callbacks.forEach { it.navigateToRoom(roomId, emptyList()) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,15 +186,15 @@ class JoinedRoomLoadedFlowNode(
|
||||
|
||||
private fun createSpaceNode(buildContext: BuildContext): Node {
|
||||
val callback = object : SpaceEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId, viaParameters: List<String>) {
|
||||
callbacks.forEach { it.onOpenRoom(roomId, viaParameters) }
|
||||
override fun navigateToRoom(roomId: RoomId, viaParameters: List<String>) {
|
||||
callbacks.forEach { it.navigateToRoom(roomId, viaParameters) }
|
||||
}
|
||||
|
||||
override fun onOpenDetails() {
|
||||
override fun navigateToRoomDetails() {
|
||||
backstack.push(NavTarget.RoomDetails)
|
||||
}
|
||||
|
||||
override fun onOpenMemberList() {
|
||||
override fun navigateToRoomMemberList() {
|
||||
backstack.push(NavTarget.RoomMemberList)
|
||||
}
|
||||
}
|
||||
@@ -209,24 +209,24 @@ class JoinedRoomLoadedFlowNode(
|
||||
navTarget: NavTarget.Messages,
|
||||
): Node {
|
||||
val callback = object : MessagesEntryPoint.Callback {
|
||||
override fun onRoomDetailsClick() {
|
||||
override fun navigateToRoomDetails() {
|
||||
backstack.push(NavTarget.RoomDetails)
|
||||
}
|
||||
|
||||
override fun onUserDataClick(userId: UserId) {
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
backstack.push(NavTarget.RoomMemberDetails(userId))
|
||||
}
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
callbacks.forEach { it.onPermalinkClick(data, pushToBackstack) }
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
callbacks.forEach { it.handlePermalinkClick(data, pushToBackstack) }
|
||||
}
|
||||
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
backstack.push(NavTarget.ForwardEvent(eventId))
|
||||
}
|
||||
|
||||
override fun openRoom(roomId: RoomId) {
|
||||
callbacks.forEach { it.onOpenRoom(roomId, emptyList()) }
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
callbacks.forEach { it.navigateToRoom(roomId, emptyList()) }
|
||||
}
|
||||
}
|
||||
val params = MessagesEntryPoint.Params(
|
||||
|
||||
@@ -212,7 +212,7 @@ class JoinedRoomLoadedFlowNodeTest {
|
||||
)
|
||||
val roomFlowNodeTestHelper = roomFlowNode.parentNodeTestHelper()
|
||||
// WHEN
|
||||
fakeMessagesEntryPoint.callback?.onRoomDetailsClick()
|
||||
fakeMessagesEntryPoint.callback?.navigateToRoomDetails()
|
||||
// THEN
|
||||
roomFlowNodeTestHelper.assertChildHasLifecycle(JoinedRoomLoadedFlowNode.NavTarget.RoomDetails, Lifecycle.State.CREATED)
|
||||
val roomDetailsNode = roomFlowNode.childNode(JoinedRoomLoadedFlowNode.NavTarget.RoomDetails)!!
|
||||
|
||||
@@ -82,23 +82,22 @@ class FtueSessionVerificationFlowNode(
|
||||
return when (navTarget) {
|
||||
is NavTarget.Root -> {
|
||||
val callback = object : ChooseSelfVerificationModeNode.Callback {
|
||||
override fun onUseAnotherDevice() {
|
||||
override fun navigateToUseAnotherDevice() {
|
||||
backstack.push(NavTarget.UseAnotherDevice)
|
||||
}
|
||||
|
||||
override fun onUseRecoveryKey() {
|
||||
override fun navigateToUseRecoveryKey() {
|
||||
backstack.push(NavTarget.EnterRecoveryKey)
|
||||
}
|
||||
|
||||
override fun onResetKey() {
|
||||
override fun navigateToResetKey() {
|
||||
backstack.push(NavTarget.ResetIdentity)
|
||||
}
|
||||
|
||||
override fun onLearnMoreAboutEncryption() {
|
||||
override fun navigateToLearnMoreAboutEncryption() {
|
||||
learnMoreUrl.value = LearnMoreConfig.DEVICE_VERIFICATION_URL
|
||||
}
|
||||
}
|
||||
|
||||
createNode<ChooseSelfVerificationModeNode>(buildContext, plugins = listOf(callback))
|
||||
}
|
||||
is NavTarget.UseAnotherDevice -> {
|
||||
@@ -116,7 +115,7 @@ class FtueSessionVerificationFlowNode(
|
||||
backstack.pop()
|
||||
}
|
||||
|
||||
override fun onLearnMoreAboutEncryption() {
|
||||
override fun navigateToLearnMoreAboutEncryption() {
|
||||
// Note that this callback is never called. The "Learn more" link is not displayed
|
||||
// for the self session interactive verification.
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ class ChooseSelfVerificationModeNode(
|
||||
private val directLogoutView: DirectLogoutView,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onUseAnotherDevice()
|
||||
fun onUseRecoveryKey()
|
||||
fun onResetKey()
|
||||
fun onLearnMoreAboutEncryption()
|
||||
fun navigateToUseAnotherDevice()
|
||||
fun navigateToUseRecoveryKey()
|
||||
fun navigateToResetKey()
|
||||
fun navigateToLearnMoreAboutEncryption()
|
||||
}
|
||||
|
||||
private val callback = plugins<Callback>().first()
|
||||
@@ -43,10 +43,10 @@ class ChooseSelfVerificationModeNode(
|
||||
|
||||
ChooseSelfVerificationModeView(
|
||||
state = state,
|
||||
onUseAnotherDevice = callback::onUseAnotherDevice,
|
||||
onUseRecoveryKey = callback::onUseRecoveryKey,
|
||||
onResetKey = callback::onResetKey,
|
||||
onLearnMore = callback::onLearnMoreAboutEncryption,
|
||||
onUseAnotherDevice = callback::navigateToUseAnotherDevice,
|
||||
onUseRecoveryKey = callback::navigateToUseRecoveryKey,
|
||||
onResetKey = callback::navigateToResetKey,
|
||||
onLearnMore = callback::navigateToLearnMoreAboutEncryption,
|
||||
modifier = modifier,
|
||||
)
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ interface HomeEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onRoomClick(roomId: RoomId)
|
||||
fun onStartChatClick()
|
||||
fun onSettingsClick()
|
||||
fun onSetUpRecoveryClick()
|
||||
fun onSessionConfirmRecoveryKeyClick()
|
||||
fun onRoomSettingsClick(roomId: RoomId)
|
||||
fun onReportBugClick()
|
||||
fun navigateToRoom(roomId: RoomId)
|
||||
fun navigateToCreateRoom()
|
||||
fun navigateToSettings()
|
||||
fun navigateToSetUpRecovery()
|
||||
fun navigateToEnterRecoveryKey()
|
||||
fun navigateToRoomSettings(roomId: RoomId)
|
||||
fun navigateToBugReport()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,27 +116,27 @@ class HomeFlowNode(
|
||||
}
|
||||
|
||||
private fun onRoomClick(roomId: RoomId) {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onRoomClick(roomId) }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToRoom(roomId) }
|
||||
}
|
||||
|
||||
private fun onOpenSettings() {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onSettingsClick() }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToSettings() }
|
||||
}
|
||||
|
||||
private fun onStartChatClick() {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onStartChatClick() }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToCreateRoom() }
|
||||
}
|
||||
|
||||
private fun onSetUpRecoveryClick() {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onSetUpRecoveryClick() }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToSetUpRecovery() }
|
||||
}
|
||||
|
||||
private fun onSessionConfirmRecoveryKeyClick() {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onSessionConfirmRecoveryKeyClick() }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToEnterRecoveryKey() }
|
||||
}
|
||||
|
||||
private fun onRoomSettingsClick(roomId: RoomId) {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onRoomSettingsClick(roomId) }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToRoomSettings(roomId) }
|
||||
}
|
||||
|
||||
private fun onReportRoomClick(roomId: RoomId) {
|
||||
@@ -153,7 +153,7 @@ class HomeFlowNode(
|
||||
inviteFriendsUseCase.execute(activity)
|
||||
}
|
||||
RoomListMenuAction.ReportBug -> {
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.onReportBugClick() }
|
||||
plugins<HomeEntryPoint.Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ class DefaultHomeEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : HomeEntryPoint.Callback {
|
||||
override fun onRoomClick(roomId: RoomId) = lambdaError()
|
||||
override fun onStartChatClick() = lambdaError()
|
||||
override fun onSettingsClick() = lambdaError()
|
||||
override fun onSetUpRecoveryClick() = lambdaError()
|
||||
override fun onSessionConfirmRecoveryKeyClick() = lambdaError()
|
||||
override fun onRoomSettingsClick(roomId: RoomId) = lambdaError()
|
||||
override fun onReportBugClick() = lambdaError()
|
||||
override fun navigateToRoom(roomId: RoomId) = lambdaError()
|
||||
override fun navigateToCreateRoom() = lambdaError()
|
||||
override fun navigateToSettings() = lambdaError()
|
||||
override fun navigateToSetUpRecovery() = lambdaError()
|
||||
override fun navigateToEnterRecoveryKey() = lambdaError()
|
||||
override fun navigateToRoomSettings(roomId: RoomId) = lambdaError()
|
||||
override fun navigateToBugReport() = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.callback(callback)
|
||||
|
||||
@@ -52,7 +52,7 @@ class DependenciesFlowNode(
|
||||
return when (navTarget) {
|
||||
is NavTarget.LicensesList -> {
|
||||
val callback = object : DependencyLicensesListNode.Callback {
|
||||
override fun onOpenLicense(license: DependencyLicenseItem) {
|
||||
override fun navigateToLicense(license: DependencyLicenseItem) {
|
||||
backstack.push(NavTarget.LicenseDetails(license))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ class DependencyLicensesListNode(
|
||||
plugins = plugins
|
||||
) {
|
||||
interface Callback : Plugin {
|
||||
fun onOpenLicense(license: DependencyLicenseItem)
|
||||
fun navigateToLicense(license: DependencyLicenseItem)
|
||||
}
|
||||
|
||||
private fun onOpenLicense(license: DependencyLicenseItem) {
|
||||
plugins<Callback>()
|
||||
.forEach { it.onOpenLicense(license) }
|
||||
.forEach { it.navigateToLicense(license) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -110,7 +110,7 @@ class LockScreenSettingsFlowNode(
|
||||
}
|
||||
NavTarget.Settings -> {
|
||||
val callback = object : LockScreenSettingsNode.Callback {
|
||||
override fun onChangePinClick() {
|
||||
override fun navigateToSetupPin() {
|
||||
backstack.push(NavTarget.SetupPin)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ class LockScreenSettingsNode(
|
||||
private val presenter: LockScreenSettingsPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onChangePinClick()
|
||||
fun navigateToSetupPin()
|
||||
}
|
||||
|
||||
private fun onChangePinClick() {
|
||||
plugins<Callback>().forEach { it.onChangePinClick() }
|
||||
plugins<Callback>().forEach { it.navigateToSetupPin() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -19,7 +19,7 @@ interface LoginEntryPoint : FeatureEntryPoint {
|
||||
)
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onReportProblem()
|
||||
fun navigateToBugReport()
|
||||
}
|
||||
|
||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||
|
||||
@@ -126,13 +126,13 @@ class LoginFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.OnBoarding -> {
|
||||
val callback = object : OnBoardingNode.Callback {
|
||||
override fun onSignUp() {
|
||||
override fun navigateToSignUpFlow() {
|
||||
backstack.push(
|
||||
NavTarget.ConfirmAccountProvider(isAccountCreation = true)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSignIn(mustChooseAccountProvider: Boolean) {
|
||||
override fun navigateToSignInFlow(mustChooseAccountProvider: Boolean) {
|
||||
backstack.push(
|
||||
if (mustChooseAccountProvider) {
|
||||
NavTarget.ChooseAccountProvider
|
||||
@@ -142,23 +142,23 @@ class LoginFlowNode(
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSignInWithQrCode() {
|
||||
override fun navigateToQrCode() {
|
||||
backstack.push(NavTarget.QrCode)
|
||||
}
|
||||
|
||||
override fun onReportProblem() {
|
||||
plugins<LoginEntryPoint.Callback>().forEach { it.onReportProblem() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<LoginEntryPoint.Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
override fun onOidcDetails(oidcDetails: OidcDetails) {
|
||||
override fun navigateToOidc(oidcDetails: OidcDetails) {
|
||||
navigateToMas(oidcDetails)
|
||||
}
|
||||
|
||||
override fun onCreateAccountContinue(url: String) {
|
||||
override fun navigateToCreateAccount(url: String) {
|
||||
backstack.push(NavTarget.CreateAccount(url))
|
||||
}
|
||||
|
||||
override fun onLoginPasswordNeeded() {
|
||||
override fun navigateToLoginPassword() {
|
||||
backstack.push(NavTarget.LoginPassword)
|
||||
}
|
||||
}
|
||||
@@ -171,15 +171,15 @@ class LoginFlowNode(
|
||||
}
|
||||
NavTarget.ChooseAccountProvider -> {
|
||||
val callback = object : ChooseAccountProviderNode.Callback {
|
||||
override fun onOidcDetails(oidcDetails: OidcDetails) {
|
||||
override fun navigateToOidc(oidcDetails: OidcDetails) {
|
||||
navigateToMas(oidcDetails)
|
||||
}
|
||||
|
||||
override fun onCreateAccountContinue(url: String) {
|
||||
override fun navigateToCreateAccount(url: String) {
|
||||
backstack.push(NavTarget.CreateAccount(url))
|
||||
}
|
||||
|
||||
override fun onLoginPasswordNeeded() {
|
||||
override fun navigateToLoginPassword() {
|
||||
backstack.push(NavTarget.LoginPassword)
|
||||
}
|
||||
}
|
||||
@@ -193,19 +193,19 @@ class LoginFlowNode(
|
||||
isAccountCreation = navTarget.isAccountCreation,
|
||||
)
|
||||
val callback = object : ConfirmAccountProviderNode.Callback {
|
||||
override fun onOidcDetails(oidcDetails: OidcDetails) {
|
||||
override fun navigateToOidc(oidcDetails: OidcDetails) {
|
||||
navigateToMas(oidcDetails)
|
||||
}
|
||||
|
||||
override fun onCreateAccountContinue(url: String) {
|
||||
override fun navigateToCreateAccount(url: String) {
|
||||
backstack.push(NavTarget.CreateAccount(url))
|
||||
}
|
||||
|
||||
override fun onLoginPasswordNeeded() {
|
||||
override fun navigateToLoginPassword() {
|
||||
backstack.push(NavTarget.LoginPassword)
|
||||
}
|
||||
|
||||
override fun onChangeAccountProvider() {
|
||||
override fun navigateToChangeAccountProvider() {
|
||||
backstack.push(NavTarget.ChangeAccountProvider)
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ class LoginFlowNode(
|
||||
backstack.singleTop(confirmAccountProvider)
|
||||
}
|
||||
|
||||
override fun onOtherClick() {
|
||||
override fun navigateToSearchAccountProvider() {
|
||||
backstack.push(NavTarget.SearchAccountProvider)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,11 +147,11 @@ class QrCodeLoginFlowNode(
|
||||
return when (navTarget) {
|
||||
is NavTarget.Initial -> {
|
||||
val callback = object : QrCodeIntroNode.Callback {
|
||||
override fun onCancelClicked() {
|
||||
override fun cancel() {
|
||||
navigateUp()
|
||||
}
|
||||
|
||||
override fun onContinue() {
|
||||
override fun navigateToQrCodeScan() {
|
||||
backstack.push(NavTarget.QrCodeScan)
|
||||
}
|
||||
}
|
||||
@@ -159,11 +159,11 @@ class QrCodeLoginFlowNode(
|
||||
}
|
||||
is NavTarget.QrCodeScan -> {
|
||||
val callback = object : QrCodeScanNode.Callback {
|
||||
override fun onScannedCode(qrCodeLoginData: MatrixQrCodeLoginData) {
|
||||
override fun handleScannedCode(qrCodeLoginData: MatrixQrCodeLoginData) {
|
||||
lifecycleScope.startAuthentication(qrCodeLoginData)
|
||||
}
|
||||
|
||||
override fun onCancelClicked() {
|
||||
override fun cancel() {
|
||||
backstack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class ChangeAccountProviderNode(
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onDone()
|
||||
fun onOtherClick()
|
||||
fun navigateToSearchAccountProvider()
|
||||
}
|
||||
|
||||
private fun onDone() {
|
||||
@@ -37,7 +37,7 @@ class ChangeAccountProviderNode(
|
||||
}
|
||||
|
||||
private fun onOtherClick() {
|
||||
plugins<Callback>().forEach { it.onOtherClick() }
|
||||
plugins<Callback>().forEach { it.navigateToSearchAccountProvider() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -29,21 +29,21 @@ class ChooseAccountProviderNode(
|
||||
private val presenter: ChooseAccountProviderPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onLoginPasswordNeeded()
|
||||
fun onOidcDetails(oidcDetails: OidcDetails)
|
||||
fun onCreateAccountContinue(url: String)
|
||||
fun navigateToLoginPassword()
|
||||
fun navigateToOidc(oidcDetails: OidcDetails)
|
||||
fun navigateToCreateAccount(url: String)
|
||||
}
|
||||
|
||||
private fun onOidcDetails(oidcDetails: OidcDetails) {
|
||||
plugins<Callback>().forEach { it.onOidcDetails(oidcDetails) }
|
||||
plugins<Callback>().forEach { it.navigateToOidc(oidcDetails) }
|
||||
}
|
||||
|
||||
private fun onLoginPasswordNeeded() {
|
||||
plugins<Callback>().forEach { it.onLoginPasswordNeeded() }
|
||||
plugins<Callback>().forEach { it.navigateToLoginPassword() }
|
||||
}
|
||||
|
||||
private fun onCreateAccountContinue(url: String) {
|
||||
plugins<Callback>().forEach { it.onCreateAccountContinue(url) }
|
||||
plugins<Callback>().forEach { it.navigateToCreateAccount(url) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -42,26 +42,26 @@ class ConfirmAccountProviderNode(
|
||||
)
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onLoginPasswordNeeded()
|
||||
fun onOidcDetails(oidcDetails: OidcDetails)
|
||||
fun onCreateAccountContinue(url: String)
|
||||
fun onChangeAccountProvider()
|
||||
fun navigateToLoginPassword()
|
||||
fun navigateToOidc(oidcDetails: OidcDetails)
|
||||
fun navigateToCreateAccount(url: String)
|
||||
fun navigateToChangeAccountProvider()
|
||||
}
|
||||
|
||||
private fun onOidcDetails(data: OidcDetails) {
|
||||
plugins<Callback>().forEach { it.onOidcDetails(data) }
|
||||
plugins<Callback>().forEach { it.navigateToOidc(data) }
|
||||
}
|
||||
|
||||
private fun onLoginPasswordNeeded() {
|
||||
plugins<Callback>().forEach { it.onLoginPasswordNeeded() }
|
||||
plugins<Callback>().forEach { it.navigateToLoginPassword() }
|
||||
}
|
||||
|
||||
private fun onCreateAccountContinue(url: String) {
|
||||
plugins<Callback>().forEach { it.onCreateAccountContinue(url) }
|
||||
plugins<Callback>().forEach { it.navigateToCreateAccount(url) }
|
||||
}
|
||||
|
||||
private fun onChangeAccountProvider() {
|
||||
plugins<Callback>().forEach { it.onChangeAccountProvider() }
|
||||
plugins<Callback>().forEach { it.navigateToChangeAccountProvider() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -34,13 +34,13 @@ class OnBoardingNode(
|
||||
plugins = plugins
|
||||
) {
|
||||
interface Callback : Plugin {
|
||||
fun onSignUp()
|
||||
fun onSignIn(mustChooseAccountProvider: Boolean)
|
||||
fun onSignInWithQrCode()
|
||||
fun onReportProblem()
|
||||
fun onLoginPasswordNeeded()
|
||||
fun onOidcDetails(oidcDetails: OidcDetails)
|
||||
fun onCreateAccountContinue(url: String)
|
||||
fun navigateToSignUpFlow()
|
||||
fun navigateToSignInFlow(mustChooseAccountProvider: Boolean)
|
||||
fun navigateToQrCode()
|
||||
fun navigateToBugReport()
|
||||
fun navigateToLoginPassword()
|
||||
fun navigateToOidc(oidcDetails: OidcDetails)
|
||||
fun navigateToCreateAccount(url: String)
|
||||
}
|
||||
|
||||
data class Params(
|
||||
@@ -55,31 +55,31 @@ class OnBoardingNode(
|
||||
)
|
||||
|
||||
private fun onSignIn(mustChooseAccountProvider: Boolean) {
|
||||
plugins<Callback>().forEach { it.onSignIn(mustChooseAccountProvider) }
|
||||
plugins<Callback>().forEach { it.navigateToSignInFlow(mustChooseAccountProvider) }
|
||||
}
|
||||
|
||||
private fun onSignUp() {
|
||||
plugins<Callback>().forEach { it.onSignUp() }
|
||||
plugins<Callback>().forEach { it.navigateToSignUpFlow() }
|
||||
}
|
||||
|
||||
private fun onSignInWithQrCode() {
|
||||
plugins<Callback>().forEach { it.onSignInWithQrCode() }
|
||||
plugins<Callback>().forEach { it.navigateToQrCode() }
|
||||
}
|
||||
|
||||
private fun onReportProblem() {
|
||||
plugins<Callback>().forEach { it.onReportProblem() }
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
private fun onOidcDetails(data: OidcDetails) {
|
||||
plugins<Callback>().forEach { it.onOidcDetails(data) }
|
||||
plugins<Callback>().forEach { it.navigateToOidc(data) }
|
||||
}
|
||||
|
||||
private fun onLoginPasswordNeeded() {
|
||||
plugins<Callback>().forEach { it.onLoginPasswordNeeded() }
|
||||
plugins<Callback>().forEach { it.navigateToLoginPassword() }
|
||||
}
|
||||
|
||||
private fun onCreateAccountContinue(url: String) {
|
||||
plugins<Callback>().forEach { it.onCreateAccountContinue(url) }
|
||||
plugins<Callback>().forEach { it.navigateToCreateAccount(url) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -26,16 +26,16 @@ class QrCodeIntroNode(
|
||||
private val presenter: QrCodeIntroPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onCancelClicked()
|
||||
fun onContinue()
|
||||
fun cancel()
|
||||
fun navigateToQrCodeScan()
|
||||
}
|
||||
|
||||
private fun onCancelClicked() {
|
||||
plugins<Callback>().forEach { it.onCancelClicked() }
|
||||
plugins<Callback>().forEach { it.cancel() }
|
||||
}
|
||||
|
||||
private fun onContinue() {
|
||||
plugins<Callback>().forEach { it.onContinue() }
|
||||
plugins<Callback>().forEach { it.navigateToQrCodeScan() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -27,16 +27,16 @@ class QrCodeScanNode(
|
||||
private val presenter: QrCodeScanPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onScannedCode(qrCodeLoginData: MatrixQrCodeLoginData)
|
||||
fun onCancelClicked()
|
||||
fun handleScannedCode(qrCodeLoginData: MatrixQrCodeLoginData)
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
private fun onQrCodeDataReady(qrCodeLoginData: MatrixQrCodeLoginData) {
|
||||
plugins<Callback>().forEach { it.onScannedCode(qrCodeLoginData) }
|
||||
plugins<Callback>().forEach { it.handleScannedCode(qrCodeLoginData) }
|
||||
}
|
||||
|
||||
private fun onCancelClicked() {
|
||||
plugins<Callback>().forEach { it.onCancelClicked() }
|
||||
plugins<Callback>().forEach { it.cancel() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -39,7 +39,7 @@ class DefaultLoginEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : LoginEntryPoint.Callback {
|
||||
override fun onReportProblem() = lambdaError()
|
||||
override fun navigateToBugReport() = lambdaError()
|
||||
}
|
||||
val params = LoginEntryPoint.Params(
|
||||
accountProvider = "ac",
|
||||
|
||||
@@ -21,6 +21,6 @@ interface LogoutEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onChangeRecoveryKeyClick()
|
||||
fun navigateToSecureBackup()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class LogoutNode(
|
||||
private val presenter: LogoutPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
private fun onChangeRecoveryKeyClick() {
|
||||
plugins<LogoutEntryPoint.Callback>().forEach { it.onChangeRecoveryKeyClick() }
|
||||
plugins<LogoutEntryPoint.Callback>().forEach { it.navigateToSecureBackup() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -32,7 +32,7 @@ class DefaultLogoutEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : LogoutEntryPoint.Callback {
|
||||
override fun onChangeRecoveryKeyClick() = lambdaError()
|
||||
override fun navigateToSecureBackup() = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.callback(callback)
|
||||
|
||||
@@ -38,11 +38,11 @@ interface MessagesEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onRoomDetailsClick()
|
||||
fun onUserDataClick(userId: UserId)
|
||||
fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun navigateToRoomDetails()
|
||||
fun navigateToRoomMemberDetails(userId: UserId)
|
||||
fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
fun openRoom(roomId: RoomId)
|
||||
fun navigateToRoom(roomId: RoomId)
|
||||
}
|
||||
|
||||
data class Params(val initialTarget: InitialTarget) : NodeInputs
|
||||
|
||||
@@ -220,18 +220,18 @@ class MessagesFlowNode(
|
||||
return when (navTarget) {
|
||||
is NavTarget.Messages -> {
|
||||
val callback = object : MessagesNode.Callback {
|
||||
override fun onRoomDetailsClick() {
|
||||
callbacks.forEach { it.onRoomDetailsClick() }
|
||||
override fun navigateToRoomDetails() {
|
||||
callbacks.forEach { it.navigateToRoomDetails() }
|
||||
}
|
||||
|
||||
override fun onEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean {
|
||||
override fun handleEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean {
|
||||
return processEventClick(
|
||||
timelineMode = timelineMode,
|
||||
event = event,
|
||||
)
|
||||
}
|
||||
|
||||
override fun onPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
override fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
backstack.push(
|
||||
NavTarget.AttachmentPreview(
|
||||
attachment = attachments.first(),
|
||||
@@ -241,39 +241,39 @@ class MessagesFlowNode(
|
||||
)
|
||||
}
|
||||
|
||||
override fun onUserDataClick(userId: UserId) {
|
||||
callbacks.forEach { it.onUserDataClick(userId) }
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(userId) }
|
||||
}
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData) {
|
||||
callbacks.forEach { it.onPermalinkClick(data, pushToBackstack = true) }
|
||||
override fun handlePermalinkClick(data: PermalinkData) {
|
||||
callbacks.forEach { it.handlePermalinkClick(data, pushToBackstack = true) }
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
backstack.push(NavTarget.EventDebugInfo(eventId, debugInfo))
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
backstack.push(NavTarget.ForwardEvent(eventId, fromPinnedEvents = false))
|
||||
}
|
||||
|
||||
override fun onReportMessage(eventId: EventId, senderId: UserId) {
|
||||
override fun navigateToReportMessage(eventId: EventId, senderId: UserId) {
|
||||
backstack.push(NavTarget.ReportMessage(eventId, senderId))
|
||||
}
|
||||
|
||||
override fun onSendLocationClick() {
|
||||
override fun navigateToSendLocation() {
|
||||
backstack.push(NavTarget.SendLocation(Timeline.Mode.Live))
|
||||
}
|
||||
|
||||
override fun onCreatePollClick() {
|
||||
override fun navigateToCreatePoll() {
|
||||
backstack.push(NavTarget.CreatePoll(Timeline.Mode.Live))
|
||||
}
|
||||
|
||||
override fun onEditPollClick(eventId: EventId) {
|
||||
override fun navigateToEditPoll(eventId: EventId) {
|
||||
backstack.push(NavTarget.EditPoll(Timeline.Mode.Live, eventId))
|
||||
}
|
||||
|
||||
override fun onJoinCallClick(roomId: RoomId) {
|
||||
override fun navigateToRoomCall(roomId: RoomId) {
|
||||
val callType = CallType.RoomCall(
|
||||
sessionId = sessionId,
|
||||
roomId = roomId,
|
||||
@@ -282,15 +282,15 @@ class MessagesFlowNode(
|
||||
elementCallEntryPoint.startCall(callType)
|
||||
}
|
||||
|
||||
override fun onViewAllPinnedEvents() {
|
||||
override fun navigateToPinnedMessagesList() {
|
||||
backstack.push(NavTarget.PinnedMessagesList)
|
||||
}
|
||||
|
||||
override fun onViewKnockRequests() {
|
||||
override fun navigateToKnockRequestsList() {
|
||||
backstack.push(NavTarget.KnockRequestsList)
|
||||
}
|
||||
|
||||
override fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
override fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
backstack.push(NavTarget.Thread(threadRootId, focusedEventId))
|
||||
}
|
||||
}
|
||||
@@ -311,13 +311,13 @@ class MessagesFlowNode(
|
||||
overlay.hide()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
viewInTimeline(eventId)
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
this@MessagesFlowNode.viewInTimeline(eventId)
|
||||
}
|
||||
|
||||
override fun onForwardEvent(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
// Need to go to the parent because of the overlay
|
||||
forwardEvent(eventId)
|
||||
callbacks.forEach { it.forwardEvent(eventId) }
|
||||
}
|
||||
}
|
||||
mediaViewerEntryPoint.nodeBuilder(this, buildContext)
|
||||
@@ -352,7 +352,7 @@ class MessagesFlowNode(
|
||||
override fun onDone(roomIds: List<RoomId>) {
|
||||
backstack.pop()
|
||||
roomIds.singleOrNull()?.let { roomId ->
|
||||
callbacks.forEach { it.openRoom(roomId) }
|
||||
callbacks.forEach { it.navigateToRoom(roomId) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,30 +392,30 @@ class MessagesFlowNode(
|
||||
}
|
||||
NavTarget.PinnedMessagesList -> {
|
||||
val callback = object : PinnedMessagesListNode.Callback {
|
||||
override fun onEventClick(event: TimelineItem.Event) {
|
||||
override fun handleEventClick(event: TimelineItem.Event) {
|
||||
processEventClick(
|
||||
timelineMode = Timeline.Mode.PinnedEvents,
|
||||
event = event,
|
||||
)
|
||||
}
|
||||
|
||||
override fun onUserDataClick(userId: UserId) {
|
||||
callbacks.forEach { it.onUserDataClick(userId) }
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(userId) }
|
||||
}
|
||||
|
||||
override fun onViewInTimelineClick(eventId: EventId) {
|
||||
viewInTimeline(eventId)
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
this@MessagesFlowNode.viewInTimeline(eventId)
|
||||
}
|
||||
|
||||
override fun onRoomPermalinkClick(data: PermalinkData.RoomLink) {
|
||||
callbacks.forEach { it.onPermalinkClick(data, pushToBackstack = !room.matches(data.roomIdOrAlias)) }
|
||||
override fun handlePermalinkClick(data: PermalinkData.RoomLink) {
|
||||
callbacks.forEach { it.handlePermalinkClick(data, pushToBackstack = !room.matches(data.roomIdOrAlias)) }
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
backstack.push(NavTarget.EventDebugInfo(eventId, debugInfo))
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
override fun handleForwardEventClick(eventId: EventId) {
|
||||
backstack.push(NavTarget.ForwardEvent(eventId = eventId, fromPinnedEvents = true))
|
||||
}
|
||||
}
|
||||
@@ -430,14 +430,14 @@ class MessagesFlowNode(
|
||||
focusedEventId = navTarget.focusedEventId,
|
||||
)
|
||||
val callback = object : ThreadedMessagesNode.Callback {
|
||||
override fun onEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean {
|
||||
override fun handleEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean {
|
||||
return processEventClick(
|
||||
timelineMode = timelineMode,
|
||||
event = event,
|
||||
)
|
||||
}
|
||||
|
||||
override fun onPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
override fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
backstack.push(
|
||||
NavTarget.AttachmentPreview(
|
||||
attachment = attachments.first(),
|
||||
@@ -447,39 +447,39 @@ class MessagesFlowNode(
|
||||
)
|
||||
}
|
||||
|
||||
override fun onUserDataClick(userId: UserId) {
|
||||
callbacks.forEach { it.onUserDataClick(userId) }
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(userId) }
|
||||
}
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData) {
|
||||
callbacks.forEach { it.onPermalinkClick(data, pushToBackstack = true) }
|
||||
override fun handlePermalinkClick(data: PermalinkData) {
|
||||
callbacks.forEach { it.handlePermalinkClick(data, pushToBackstack = true) }
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
backstack.push(NavTarget.EventDebugInfo(eventId, debugInfo))
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
override fun handleForwardEventClick(eventId: EventId) {
|
||||
backstack.push(NavTarget.ForwardEvent(eventId, fromPinnedEvents = false))
|
||||
}
|
||||
|
||||
override fun onReportMessage(eventId: EventId, senderId: UserId) {
|
||||
override fun navigateToReportMessage(eventId: EventId, senderId: UserId) {
|
||||
backstack.push(NavTarget.ReportMessage(eventId, senderId))
|
||||
}
|
||||
|
||||
override fun onSendLocationClick() {
|
||||
override fun navigateToSendLocation() {
|
||||
backstack.push(NavTarget.SendLocation(Timeline.Mode.Thread(navTarget.threadRootId)))
|
||||
}
|
||||
|
||||
override fun onCreatePollClick() {
|
||||
override fun navigateToCreatePoll() {
|
||||
backstack.push(NavTarget.CreatePoll(Timeline.Mode.Thread(navTarget.threadRootId)))
|
||||
}
|
||||
|
||||
override fun onEditPollClick(eventId: EventId) {
|
||||
override fun navigateToEditPoll(eventId: EventId) {
|
||||
backstack.push(NavTarget.EditPoll(Timeline.Mode.Thread(navTarget.threadRootId), eventId))
|
||||
}
|
||||
|
||||
override fun onJoinCallClick(roomId: RoomId) {
|
||||
override fun navigateToRoomCall(roomId: RoomId) {
|
||||
val callType = CallType.RoomCall(
|
||||
sessionId = sessionId,
|
||||
roomId = roomId,
|
||||
@@ -488,7 +488,7 @@ class MessagesFlowNode(
|
||||
elementCallEntryPoint.startCall(callType)
|
||||
}
|
||||
|
||||
override fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
override fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
backstack.push(NavTarget.Thread(threadRootId, focusedEventId))
|
||||
}
|
||||
}
|
||||
@@ -502,11 +502,7 @@ class MessagesFlowNode(
|
||||
roomIdOrAlias = room.roomId.toRoomIdOrAlias(),
|
||||
eventId = eventId,
|
||||
)
|
||||
callbacks.forEach { it.onPermalinkClick(permalinkData, pushToBackstack = false) }
|
||||
}
|
||||
|
||||
private fun forwardEvent(eventId: EventId) {
|
||||
callbacks.forEach { it.forwardEvent(eventId) }
|
||||
callbacks.forEach { it.handlePermalinkClick(permalinkData, pushToBackstack = false) }
|
||||
}
|
||||
|
||||
private fun processEventClick(
|
||||
|
||||
@@ -16,12 +16,12 @@ import io.element.android.libraries.matrix.api.timeline.item.TimelineItemDebugIn
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
||||
interface MessagesNavigator {
|
||||
fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun onForwardEventClick(eventId: EventId)
|
||||
fun onReportContentClick(eventId: EventId, senderId: UserId)
|
||||
fun onEditPollClick(eventId: EventId)
|
||||
fun onPreviewAttachment(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun onNavigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>)
|
||||
fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
fun navigateToReportMessage(eventId: EventId, senderId: UserId)
|
||||
fun navigateToEditPoll(eventId: EventId)
|
||||
fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun navigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>)
|
||||
fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
fun onNavigateUp()
|
||||
}
|
||||
|
||||
@@ -114,21 +114,21 @@ class MessagesNode(
|
||||
)
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean
|
||||
fun onPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun onUserDataClick(userId: UserId)
|
||||
fun onPermalinkClick(data: PermalinkData)
|
||||
fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun onForwardEventClick(eventId: EventId)
|
||||
fun onReportMessage(eventId: EventId, senderId: UserId)
|
||||
fun onSendLocationClick()
|
||||
fun onCreatePollClick()
|
||||
fun onEditPollClick(eventId: EventId)
|
||||
fun onJoinCallClick(roomId: RoomId)
|
||||
fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
fun onRoomDetailsClick()
|
||||
fun onViewAllPinnedEvents()
|
||||
fun onViewKnockRequests()
|
||||
fun handleEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean
|
||||
fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun navigateToRoomMemberDetails(userId: UserId)
|
||||
fun handlePermalinkClick(data: PermalinkData)
|
||||
fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
fun navigateToReportMessage(eventId: EventId, senderId: UserId)
|
||||
fun navigateToSendLocation()
|
||||
fun navigateToCreatePoll()
|
||||
fun navigateToEditPoll(eventId: EventId)
|
||||
fun navigateToRoomCall(roomId: RoomId)
|
||||
fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
fun navigateToRoomDetails()
|
||||
fun navigateToPinnedMessagesList()
|
||||
fun navigateToKnockRequestsList()
|
||||
}
|
||||
|
||||
override fun onBuilt() {
|
||||
@@ -143,16 +143,16 @@ class MessagesNode(
|
||||
)
|
||||
}
|
||||
|
||||
private fun onRoomDetailsClick() {
|
||||
callbacks.forEach { it.onRoomDetailsClick() }
|
||||
private fun navigateToRoomDetails() {
|
||||
callbacks.forEach { it.navigateToRoomDetails() }
|
||||
}
|
||||
|
||||
private fun onViewAllPinnedMessagesClick() {
|
||||
callbacks.forEach { it.onViewAllPinnedEvents() }
|
||||
private fun navigateToPinnedMessagesList() {
|
||||
callbacks.forEach { it.navigateToPinnedMessagesList() }
|
||||
}
|
||||
|
||||
private fun onViewKnockRequestsClick() {
|
||||
callbacks.forEach { it.onViewKnockRequests() }
|
||||
private fun navigateToKnockRequestsList() {
|
||||
callbacks.forEach { it.navigateToKnockRequestsList() }
|
||||
}
|
||||
|
||||
private fun onEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean {
|
||||
@@ -160,13 +160,13 @@ class MessagesNode(
|
||||
// - if callbacks is empty, it will return true and we want to return false.
|
||||
// - if a callback returns false, the other callback will not be invoked.
|
||||
return callbacks.takeIf { it.isNotEmpty() }
|
||||
?.map { it.onEventClick(timelineMode, event) }
|
||||
?.map { it.handleEventClick(timelineMode, event) }
|
||||
?.all { it }
|
||||
.orFalse()
|
||||
}
|
||||
|
||||
private fun onUserDataClick(userId: UserId) {
|
||||
callbacks.forEach { it.onUserDataClick(userId) }
|
||||
private fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(userId) }
|
||||
}
|
||||
|
||||
private fun onLinkClick(
|
||||
@@ -180,7 +180,7 @@ class MessagesNode(
|
||||
is PermalinkData.UserLink -> {
|
||||
// Open the room member profile, it will fallback to
|
||||
// the user profile if the user is not in the room
|
||||
callbacks.forEach { it.onUserDataClick(permalink.userId) }
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(permalink.userId) }
|
||||
}
|
||||
is PermalinkData.RoomLink -> {
|
||||
handleRoomLinkClick(permalink, eventSink)
|
||||
@@ -211,53 +211,53 @@ class MessagesNode(
|
||||
displaySameRoomToast()
|
||||
}
|
||||
} else {
|
||||
callbacks.forEach { it.onPermalinkClick(roomLink) }
|
||||
callbacks.forEach { it.handlePermalinkClick(roomLink) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.onShowEventDebugInfoClick(eventId, debugInfo) }
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.navigateToEventDebugInfo(eventId, debugInfo) }
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onForwardEventClick(eventId) }
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
callbacks.forEach { it.forwardEvent(eventId) }
|
||||
}
|
||||
|
||||
override fun onReportContentClick(eventId: EventId, senderId: UserId) {
|
||||
callbacks.forEach { it.onReportMessage(eventId, senderId) }
|
||||
override fun navigateToReportMessage(eventId: EventId, senderId: UserId) {
|
||||
callbacks.forEach { it.navigateToReportMessage(eventId, senderId) }
|
||||
}
|
||||
|
||||
override fun onEditPollClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onEditPollClick(eventId) }
|
||||
override fun navigateToEditPoll(eventId: EventId) {
|
||||
callbacks.forEach { it.navigateToEditPoll(eventId) }
|
||||
}
|
||||
|
||||
override fun onPreviewAttachment(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
callbacks.forEach { it.onPreviewAttachments(attachments, inReplyToEventId) }
|
||||
override fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
callbacks.forEach { it.navigateToPreviewAttachments(attachments, inReplyToEventId) }
|
||||
}
|
||||
|
||||
override fun onNavigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
override fun navigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
if (roomId == room.roomId) {
|
||||
displaySameRoomToast()
|
||||
} else {
|
||||
val permalinkData = PermalinkData.RoomLink(roomId.toRoomIdOrAlias(), eventId, viaParameters = serverNames.toImmutableList())
|
||||
callbacks.forEach { it.onPermalinkClick(permalinkData) }
|
||||
callbacks.forEach { it.handlePermalinkClick(permalinkData) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
callbacks.forEach { it.onOpenThread(threadRootId, focusedEventId) }
|
||||
override fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
callbacks.forEach { it.navigateToThread(threadRootId, focusedEventId) }
|
||||
}
|
||||
|
||||
private fun onSendLocationClick() {
|
||||
callbacks.forEach { it.onSendLocationClick() }
|
||||
private fun navigateToSendLocation() {
|
||||
callbacks.forEach { it.navigateToSendLocation() }
|
||||
}
|
||||
|
||||
private fun onCreatePollClick() {
|
||||
callbacks.forEach { it.onCreatePollClick() }
|
||||
private fun navigateToCreatePoll() {
|
||||
callbacks.forEach { it.navigateToCreatePoll() }
|
||||
}
|
||||
|
||||
private fun onJoinCallClick() {
|
||||
callbacks.forEach { it.onJoinCallClick(room.roomId) }
|
||||
private fun navigateToRoomCall() {
|
||||
callbacks.forEach { it.navigateToRoomCall(room.roomId) }
|
||||
}
|
||||
|
||||
private fun displaySameRoomToast() {
|
||||
@@ -288,7 +288,7 @@ class MessagesNode(
|
||||
MessagesView(
|
||||
state = state,
|
||||
onBackClick = { state.eventSink(MessagesEvents.MarkAsFullyReadAndExit) },
|
||||
onRoomDetailsClick = this::onRoomDetailsClick,
|
||||
onRoomDetailsClick = ::navigateToRoomDetails,
|
||||
onEventContentClick = { isLive, event ->
|
||||
if (isLive) {
|
||||
onEventClick(timelineController.mainTimelineMode(), event)
|
||||
@@ -301,7 +301,7 @@ class MessagesNode(
|
||||
}
|
||||
}
|
||||
},
|
||||
onUserDataClick = this::onUserDataClick,
|
||||
onUserDataClick = ::navigateToRoomMemberDetails,
|
||||
onLinkClick = { url, customTab ->
|
||||
onLinkClick(
|
||||
activity = activity,
|
||||
@@ -311,15 +311,15 @@ class MessagesNode(
|
||||
customTab = customTab,
|
||||
)
|
||||
},
|
||||
onSendLocationClick = this::onSendLocationClick,
|
||||
onCreatePollClick = this::onCreatePollClick,
|
||||
onJoinCallClick = this::onJoinCallClick,
|
||||
onViewAllPinnedMessagesClick = this::onViewAllPinnedMessagesClick,
|
||||
onSendLocationClick = ::navigateToSendLocation,
|
||||
onCreatePollClick = ::navigateToCreatePoll,
|
||||
onJoinCallClick = ::navigateToRoomCall,
|
||||
onViewAllPinnedMessagesClick = ::navigateToPinnedMessagesList,
|
||||
modifier = modifier,
|
||||
knockRequestsBannerView = {
|
||||
knockRequestsBannerRenderer.View(
|
||||
modifier = Modifier,
|
||||
onViewRequestsClick = this::onViewKnockRequestsClick
|
||||
onViewRequestsClick = ::navigateToKnockRequestsList,
|
||||
)
|
||||
},
|
||||
)
|
||||
@@ -327,7 +327,7 @@ class MessagesNode(
|
||||
state = state.roomMemberModerationState,
|
||||
onSelectAction = { action, target ->
|
||||
when (action) {
|
||||
is ModerationAction.DisplayProfile -> onUserDataClick(target.userId)
|
||||
is ModerationAction.DisplayProfile -> navigateToRoomMemberDetails(target.userId)
|
||||
else -> state.roomMemberModerationState.eventSink(RoomMemberModerationEvents.ProcessAction(action, target))
|
||||
}
|
||||
},
|
||||
|
||||
@@ -355,7 +355,7 @@ class MessagesPresenter(
|
||||
is TimelineItemThreadInfo.ThreadResponse -> targetEvent.threadInfo.threadRootId
|
||||
is TimelineItemThreadInfo.ThreadRoot, null -> targetEvent.eventId?.toThreadId()
|
||||
} ?: return@launch
|
||||
navigator.onOpenThread(threadId, null)
|
||||
navigator.navigateToThread(threadId, null)
|
||||
} else {
|
||||
handleActionReply(targetEvent, composerState, timelineProtectionState)
|
||||
}
|
||||
@@ -463,7 +463,7 @@ class MessagesPresenter(
|
||||
when (targetEvent.content) {
|
||||
is TimelineItemPollContent -> {
|
||||
if (targetEvent.eventId == null) return
|
||||
navigator.onEditPollClick(targetEvent.eventId)
|
||||
navigator.navigateToEditPoll(targetEvent.eventId)
|
||||
}
|
||||
else -> {
|
||||
val composerMode = MessageComposerMode.Edit(
|
||||
@@ -528,17 +528,17 @@ class MessagesPresenter(
|
||||
}
|
||||
|
||||
private fun handleShowDebugInfoAction(event: TimelineItem.Event) {
|
||||
navigator.onShowEventDebugInfoClick(event.eventId, event.debugInfo)
|
||||
navigator.navigateToEventDebugInfo(event.eventId, event.debugInfo)
|
||||
}
|
||||
|
||||
private fun handleForwardAction(event: TimelineItem.Event) {
|
||||
if (event.eventId == null) return
|
||||
navigator.onForwardEventClick(event.eventId)
|
||||
navigator.forwardEvent(event.eventId)
|
||||
}
|
||||
|
||||
private fun handleReportAction(event: TimelineItem.Event) {
|
||||
if (event.eventId == null) return
|
||||
navigator.onReportContentClick(event.eventId, event.senderId)
|
||||
navigator.navigateToReportMessage(event.eventId, event.senderId)
|
||||
}
|
||||
|
||||
private fun handleEndPollAction(
|
||||
|
||||
@@ -528,7 +528,7 @@ class MessageComposerPresenter(
|
||||
)
|
||||
val mediaAttachment = Attachment.Media(localMedia)
|
||||
val inReplyToEventId = (messageComposerContext.composerMode as? MessageComposerMode.Reply)?.eventId
|
||||
navigator.onPreviewAttachment(persistentListOf(mediaAttachment), inReplyToEventId)
|
||||
navigator.navigateToPreviewAttachments(persistentListOf(mediaAttachment), inReplyToEventId)
|
||||
|
||||
// Reset composer since the attachment will be sent in a separate flow
|
||||
messageComposerContext.composerMode = MessageComposerMode.Normal
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.timeline.item.TimelineItemDebugInfo
|
||||
|
||||
interface PinnedMessagesListNavigator {
|
||||
fun onViewInTimelineClick(eventId: EventId)
|
||||
fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun onForwardEventClick(eventId: EventId)
|
||||
fun viewInTimeline(eventId: EventId)
|
||||
fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ class PinnedMessagesListNode(
|
||||
private val permalinkParser: PermalinkParser,
|
||||
) : Node(buildContext, plugins = plugins), PinnedMessagesListNavigator {
|
||||
interface Callback : Plugin {
|
||||
fun onEventClick(event: TimelineItem.Event)
|
||||
fun onUserDataClick(userId: UserId)
|
||||
fun onViewInTimelineClick(eventId: EventId)
|
||||
fun onRoomPermalinkClick(data: PermalinkData.RoomLink)
|
||||
fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun onForwardEventClick(eventId: EventId)
|
||||
fun handleEventClick(event: TimelineItem.Event)
|
||||
fun navigateToRoomMemberDetails(userId: UserId)
|
||||
fun viewInTimeline(eventId: EventId)
|
||||
fun handlePermalinkClick(data: PermalinkData.RoomLink)
|
||||
fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun handleForwardEventClick(eventId: EventId)
|
||||
}
|
||||
|
||||
private val presenter = presenterFactory.create(
|
||||
@@ -65,12 +65,12 @@ class PinnedMessagesListNode(
|
||||
)
|
||||
private val callbacks = plugins<Callback>()
|
||||
|
||||
private fun onEventClick(event: TimelineItem.Event) {
|
||||
return callbacks.forEach { it.onEventClick(event) }
|
||||
private fun handleEventClick(event: TimelineItem.Event) {
|
||||
return callbacks.forEach { it.handleEventClick(event) }
|
||||
}
|
||||
|
||||
private fun onUserDataClick(user: MatrixUser) {
|
||||
callbacks.forEach { it.onUserDataClick(user.userId) }
|
||||
private fun navigateToRoomMemberDetails(user: MatrixUser) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(user.userId) }
|
||||
}
|
||||
|
||||
private fun onLinkClick(context: Context, url: String) {
|
||||
@@ -78,10 +78,10 @@ class PinnedMessagesListNode(
|
||||
is PermalinkData.UserLink -> {
|
||||
// Open the room member profile, it will fallback to
|
||||
// the user profile if the user is not in the room
|
||||
callbacks.forEach { it.onUserDataClick(permalink.userId) }
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(permalink.userId) }
|
||||
}
|
||||
is PermalinkData.RoomLink -> {
|
||||
callbacks.forEach { it.onRoomPermalinkClick(permalink) }
|
||||
callbacks.forEach { it.handlePermalinkClick(permalink) }
|
||||
}
|
||||
is PermalinkData.FallbackLink,
|
||||
is PermalinkData.RoomEmailInviteLink -> {
|
||||
@@ -90,16 +90,16 @@ class PinnedMessagesListNode(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewInTimelineClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onViewInTimelineClick(eventId) }
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
callbacks.forEach { it.viewInTimeline(eventId) }
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.onShowEventDebugInfoClick(eventId, debugInfo) }
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.navigateToEventDebugInfo(eventId, debugInfo) }
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onForwardEventClick(eventId) }
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
callbacks.forEach { it.handleForwardEventClick(eventId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -113,8 +113,8 @@ class PinnedMessagesListNode(
|
||||
PinnedMessagesListView(
|
||||
state = state,
|
||||
onBackClick = ::navigateUp,
|
||||
onEventClick = ::onEventClick,
|
||||
onUserDataClick = ::onUserDataClick,
|
||||
onEventClick = ::handleEventClick,
|
||||
onUserDataClick = ::navigateToRoomMemberDetails,
|
||||
onLinkClick = { link -> onLinkClick(context, link.url) },
|
||||
onLinkLongClick = {
|
||||
view.performHapticFeedback(
|
||||
|
||||
@@ -153,18 +153,18 @@ class PinnedMessagesListPresenter(
|
||||
) = launch {
|
||||
when (action) {
|
||||
TimelineItemAction.ViewSource -> {
|
||||
navigator.onShowEventDebugInfoClick(targetEvent.eventId, targetEvent.debugInfo)
|
||||
navigator.navigateToEventDebugInfo(targetEvent.eventId, targetEvent.debugInfo)
|
||||
}
|
||||
TimelineItemAction.Forward -> {
|
||||
targetEvent.eventId?.let { eventId ->
|
||||
navigator.onForwardEventClick(eventId)
|
||||
navigator.forwardEvent(eventId)
|
||||
}
|
||||
}
|
||||
TimelineItemAction.Unpin -> handleUnpinAction(targetEvent)
|
||||
TimelineItemAction.ViewInTimeline -> {
|
||||
targetEvent.eventId?.let { eventId ->
|
||||
analyticsService.captureInteraction(Interaction.Name.PinnedMessageListViewTimeline)
|
||||
navigator.onViewInTimelineClick(eventId)
|
||||
navigator.viewInTimeline(eventId)
|
||||
}
|
||||
}
|
||||
else -> Unit
|
||||
|
||||
@@ -113,18 +113,18 @@ class ThreadedMessagesNode(
|
||||
)
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean
|
||||
fun onPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun onUserDataClick(userId: UserId)
|
||||
fun onPermalinkClick(data: PermalinkData)
|
||||
fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun onForwardEventClick(eventId: EventId)
|
||||
fun onReportMessage(eventId: EventId, senderId: UserId)
|
||||
fun onSendLocationClick()
|
||||
fun onCreatePollClick()
|
||||
fun onEditPollClick(eventId: EventId)
|
||||
fun onJoinCallClick(roomId: RoomId)
|
||||
fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
fun handleEventClick(timelineMode: Timeline.Mode, event: TimelineItem.Event): Boolean
|
||||
fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?)
|
||||
fun navigateToRoomMemberDetails(userId: UserId)
|
||||
fun handlePermalinkClick(data: PermalinkData)
|
||||
fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo)
|
||||
fun handleForwardEventClick(eventId: EventId)
|
||||
fun navigateToReportMessage(eventId: EventId, senderId: UserId)
|
||||
fun navigateToSendLocation()
|
||||
fun navigateToCreatePoll()
|
||||
fun navigateToEditPoll(eventId: EventId)
|
||||
fun navigateToRoomCall(roomId: RoomId)
|
||||
fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?)
|
||||
}
|
||||
|
||||
override fun onBuilt() {
|
||||
@@ -150,13 +150,13 @@ class ThreadedMessagesNode(
|
||||
// - if callbacks is empty, it will return true and we want to return false.
|
||||
// - if a callback returns false, the other callback will not be invoked.
|
||||
return callbacks.takeIf { it.isNotEmpty() }
|
||||
?.map { it.onEventClick(timelineMode, event) }
|
||||
?.map { it.handleEventClick(timelineMode, event) }
|
||||
?.all { it }
|
||||
.orFalse()
|
||||
}
|
||||
|
||||
private fun onUserDataClick(userId: UserId) {
|
||||
callbacks.forEach { it.onUserDataClick(userId) }
|
||||
private fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(userId) }
|
||||
}
|
||||
|
||||
private fun onLinkClick(
|
||||
@@ -170,7 +170,7 @@ class ThreadedMessagesNode(
|
||||
is PermalinkData.UserLink -> {
|
||||
// Open the room member profile, it will fallback to
|
||||
// the user profile if the user is not in the room
|
||||
callbacks.forEach { it.onUserDataClick(permalink.userId) }
|
||||
callbacks.forEach { it.navigateToRoomMemberDetails(permalink.userId) }
|
||||
}
|
||||
is PermalinkData.RoomLink -> {
|
||||
handleRoomLinkClick(permalink, eventSink)
|
||||
@@ -204,51 +204,51 @@ class ThreadedMessagesNode(
|
||||
navigateUp()
|
||||
}
|
||||
} else {
|
||||
callbacks.forEach { it.onPermalinkClick(roomLink) }
|
||||
callbacks.forEach { it.handlePermalinkClick(roomLink) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.onShowEventDebugInfoClick(eventId, debugInfo) }
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
callbacks.forEach { it.navigateToEventDebugInfo(eventId, debugInfo) }
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onForwardEventClick(eventId) }
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
callbacks.forEach { it.handleForwardEventClick(eventId) }
|
||||
}
|
||||
|
||||
override fun onReportContentClick(eventId: EventId, senderId: UserId) {
|
||||
callbacks.forEach { it.onReportMessage(eventId, senderId) }
|
||||
override fun navigateToReportMessage(eventId: EventId, senderId: UserId) {
|
||||
callbacks.forEach { it.navigateToReportMessage(eventId, senderId) }
|
||||
}
|
||||
|
||||
override fun onEditPollClick(eventId: EventId) {
|
||||
callbacks.forEach { it.onEditPollClick(eventId) }
|
||||
override fun navigateToEditPoll(eventId: EventId) {
|
||||
callbacks.forEach { it.navigateToEditPoll(eventId) }
|
||||
}
|
||||
|
||||
override fun onPreviewAttachment(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
callbacks.forEach { it.onPreviewAttachments(attachments, inReplyToEventId) }
|
||||
override fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
callbacks.forEach { it.navigateToPreviewAttachments(attachments, inReplyToEventId) }
|
||||
}
|
||||
|
||||
override fun onNavigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
override fun navigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
val permalinkData = PermalinkData.RoomLink(roomId.toRoomIdOrAlias(), eventId, viaParameters = serverNames.toImmutableList())
|
||||
callbacks.forEach { it.onPermalinkClick(permalinkData) }
|
||||
callbacks.forEach { it.handlePermalinkClick(permalinkData) }
|
||||
}
|
||||
|
||||
override fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
callbacks.forEach { it.onOpenThread(threadRootId, focusedEventId) }
|
||||
override fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
callbacks.forEach { it.navigateToThread(threadRootId, focusedEventId) }
|
||||
}
|
||||
|
||||
override fun onNavigateUp() = navigateUp()
|
||||
|
||||
private fun onSendLocationClick() {
|
||||
callbacks.forEach { it.onSendLocationClick() }
|
||||
private fun navigateToSendLocation() {
|
||||
callbacks.forEach { it.navigateToSendLocation() }
|
||||
}
|
||||
|
||||
private fun onCreatePollClick() {
|
||||
callbacks.forEach { it.onCreatePollClick() }
|
||||
private fun navigateToCreatePoll() {
|
||||
callbacks.forEach { it.navigateToCreatePoll() }
|
||||
}
|
||||
|
||||
private fun onJoinCallClick() {
|
||||
callbacks.forEach { it.onJoinCallClick(room.roomId) }
|
||||
private fun navigateToRoomCall() {
|
||||
callbacks.forEach { it.navigateToRoomCall(room.roomId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -281,7 +281,7 @@ class ThreadedMessagesNode(
|
||||
}
|
||||
}
|
||||
},
|
||||
onUserDataClick = this::onUserDataClick,
|
||||
onUserDataClick = this::navigateToRoomMemberDetails,
|
||||
onLinkClick = { url, customTab ->
|
||||
onLinkClick(
|
||||
activity = activity,
|
||||
@@ -291,9 +291,9 @@ class ThreadedMessagesNode(
|
||||
customTab = customTab,
|
||||
)
|
||||
},
|
||||
onSendLocationClick = this::onSendLocationClick,
|
||||
onCreatePollClick = this::onCreatePollClick,
|
||||
onJoinCallClick = this::onJoinCallClick,
|
||||
onSendLocationClick = this::navigateToSendLocation,
|
||||
onCreatePollClick = this::navigateToCreatePoll,
|
||||
onJoinCallClick = this::navigateToRoomCall,
|
||||
onViewAllPinnedMessagesClick = {},
|
||||
modifier = modifier,
|
||||
knockRequestsBannerView = {},
|
||||
|
||||
@@ -185,7 +185,7 @@ class TimelinePresenter(
|
||||
}
|
||||
}
|
||||
is TimelineEvents.EditPoll -> {
|
||||
navigator.onEditPollClick(event.pollStartId)
|
||||
navigator.navigateToEditPoll(event.pollStartId)
|
||||
}
|
||||
is TimelineEvents.FocusOnEvent -> sessionCoroutineScope.launch {
|
||||
focusRequestState.value = FocusRequestState.Requested(event.eventId, event.debounce)
|
||||
@@ -210,10 +210,10 @@ class TimelinePresenter(
|
||||
is TimelineEvents.NavigateToPredecessorOrSuccessorRoom -> {
|
||||
// Navigate to the predecessor or successor room
|
||||
val serverNames = calculateServerNamesForRoom(room)
|
||||
navigator.onNavigateToRoom(event.roomId, null, serverNames)
|
||||
navigator.navigateToRoom(event.roomId, null, serverNames)
|
||||
}
|
||||
is TimelineEvents.OpenThread -> {
|
||||
navigator.onOpenThread(
|
||||
navigator.navigateToThread(
|
||||
threadRootId = event.threadRootEventId,
|
||||
focusedEventId = event.focusedEvent,
|
||||
)
|
||||
@@ -314,7 +314,7 @@ class TimelinePresenter(
|
||||
if (timelineController.mainTimelineMode() is Timeline.Mode.Thread && threadId == null) {
|
||||
// We are in a thread timeline, and the event isn't part of a thread, we need to navigate back to the room
|
||||
focusRequestState.value = FocusRequestState.None
|
||||
navigator.onNavigateToRoom(room.roomId, eventId, calculateServerNamesForRoom(room))
|
||||
navigator.navigateToRoom(room.roomId, eventId, calculateServerNamesForRoom(room))
|
||||
} else {
|
||||
Timber.tag(tag).d("Focusing on event $eventId - thread $threadId")
|
||||
timelineController.focusOnEvent(eventId, threadId)
|
||||
@@ -331,7 +331,7 @@ class TimelinePresenter(
|
||||
} else {
|
||||
focusRequestState.value = FocusRequestState.Success(eventId = result.threadId.asEventId())
|
||||
// It's part of a thread we're not in, let's open it in another timeline
|
||||
navigator.onOpenThread(result.threadId, eventId)
|
||||
navigator.navigateToThread(result.threadId, eventId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ class DefaultMessagesEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : MessagesEntryPoint.Callback {
|
||||
override fun onRoomDetailsClick() = lambdaError()
|
||||
override fun onUserDataClick(userId: UserId) = lambdaError()
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) = lambdaError()
|
||||
override fun navigateToRoomDetails() = lambdaError()
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) = lambdaError()
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) = lambdaError()
|
||||
override fun forwardEvent(eventId: EventId) = lambdaError()
|
||||
override fun openRoom(roomId: RoomId) = lambdaError()
|
||||
override fun navigateToRoom(roomId: RoomId) = lambdaError()
|
||||
}
|
||||
val initialTarget = MessagesEntryPoint.InitialTarget.Messages(focusedEventId = AN_EVENT_ID)
|
||||
val params = MessagesEntryPoint.Params(initialTarget)
|
||||
|
||||
@@ -26,31 +26,31 @@ class FakeMessagesNavigator(
|
||||
private val onOpenThreadLambda: (threadRootId: ThreadId, focusedEventId: EventId?) -> Unit = { _, _ -> lambdaError() },
|
||||
private val onNavigateUpLambda: () -> Unit = { lambdaError() },
|
||||
) : MessagesNavigator {
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
onShowEventDebugInfoClickLambda(eventId, debugInfo)
|
||||
}
|
||||
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
onForwardEventClickLambda(eventId)
|
||||
}
|
||||
|
||||
override fun onReportContentClick(eventId: EventId, senderId: UserId) {
|
||||
override fun navigateToReportMessage(eventId: EventId, senderId: UserId) {
|
||||
onReportContentClickLambda(eventId, senderId)
|
||||
}
|
||||
|
||||
override fun onEditPollClick(eventId: EventId) {
|
||||
override fun navigateToEditPoll(eventId: EventId) {
|
||||
onEditPollClickLambda(eventId)
|
||||
}
|
||||
|
||||
override fun onPreviewAttachment(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
override fun navigateToPreviewAttachments(attachments: ImmutableList<Attachment>, inReplyToEventId: EventId?) {
|
||||
onPreviewAttachmentLambda(attachments, inReplyToEventId)
|
||||
}
|
||||
|
||||
override fun onNavigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
override fun navigateToRoom(roomId: RoomId, eventId: EventId?, serverNames: List<String>) {
|
||||
onNavigateToRoomLambda(roomId, eventId, serverNames)
|
||||
}
|
||||
|
||||
override fun onOpenThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
override fun navigateToThread(threadRootId: ThreadId, focusedEventId: EventId?) {
|
||||
onOpenThreadLambda(threadRootId, focusedEventId)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,17 +12,17 @@ import io.element.android.libraries.matrix.api.timeline.item.TimelineItemDebugIn
|
||||
|
||||
class FakePinnedMessagesListNavigator : PinnedMessagesListNavigator {
|
||||
var onViewInTimelineClickLambda: ((EventId) -> Unit)? = null
|
||||
override fun onViewInTimelineClick(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
onViewInTimelineClickLambda?.invoke(eventId)
|
||||
}
|
||||
|
||||
var onShowEventDebugInfoClickLambda: ((EventId?, TimelineItemDebugInfo) -> Unit)? = null
|
||||
override fun onShowEventDebugInfoClick(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
override fun navigateToEventDebugInfo(eventId: EventId?, debugInfo: TimelineItemDebugInfo) {
|
||||
onShowEventDebugInfoClickLambda?.invoke(eventId, debugInfo)
|
||||
}
|
||||
|
||||
var onForwardEventClickLambda: ((EventId) -> Unit)? = null
|
||||
override fun onForwardEventClick(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
onForwardEventClickLambda?.invoke(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class PollHistoryFlowNode(
|
||||
}
|
||||
NavTarget.Root -> {
|
||||
val callback = object : PollHistoryNode.Callback {
|
||||
override fun onEditPoll(pollStartEventId: EventId) {
|
||||
override fun navigateToEditPoll(pollStartEventId: EventId) {
|
||||
backstack.push(NavTarget.EditPoll(pollStartEventId))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ class PollHistoryNode(
|
||||
plugins = plugins,
|
||||
) {
|
||||
interface Callback : Plugin {
|
||||
fun onEditPoll(pollStartEventId: EventId)
|
||||
fun navigateToEditPoll(pollStartEventId: EventId)
|
||||
}
|
||||
|
||||
private fun onEditPoll(pollStartEventId: EventId) {
|
||||
plugins<Callback>().forEach { it.onEditPoll(pollStartEventId) }
|
||||
plugins<Callback>().forEach { it.navigateToEditPoll(pollStartEventId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -40,10 +40,10 @@ interface PreferencesEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onAddAccount()
|
||||
fun onOpenBugReport()
|
||||
fun onSecureBackupClick()
|
||||
fun onOpenRoomNotificationSettings(roomId: RoomId)
|
||||
fun navigateTo(roomId: RoomId, eventId: EventId)
|
||||
fun navigateToAddAccount()
|
||||
fun navigateToBugReport()
|
||||
fun navigateToSecureBackup()
|
||||
fun navigateToRoomNotificationSettings(roomId: RoomId)
|
||||
fun navigateToEvent(roomId: RoomId, eventId: EventId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,59 +120,59 @@ class PreferencesFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.Root -> {
|
||||
val callback = object : PreferencesRootNode.Callback {
|
||||
override fun onAddAccount() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.onAddAccount() }
|
||||
override fun navigateToAddAccount() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToAddAccount() }
|
||||
}
|
||||
|
||||
override fun onOpenBugReport() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.onOpenBugReport() }
|
||||
override fun navigateToBugReport() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
override fun onSecureBackupClick() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.onSecureBackupClick() }
|
||||
override fun navigateToSecureBackup() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToSecureBackup() }
|
||||
}
|
||||
|
||||
override fun onOpenAnalytics() {
|
||||
override fun navigateToAnalyticsSettings() {
|
||||
backstack.push(NavTarget.AnalyticsSettings)
|
||||
}
|
||||
|
||||
override fun onOpenAbout() {
|
||||
override fun navigateToAbout() {
|
||||
backstack.push(NavTarget.About)
|
||||
}
|
||||
|
||||
override fun onOpenDeveloperSettings() {
|
||||
override fun navigateToDeveloperSettings() {
|
||||
backstack.push(NavTarget.DeveloperSettings)
|
||||
}
|
||||
|
||||
override fun onOpenNotificationSettings() {
|
||||
override fun navigateToNotificationSettings() {
|
||||
backstack.push(NavTarget.NotificationSettings)
|
||||
}
|
||||
|
||||
override fun onOpenLockScreenSettings() {
|
||||
override fun navigateToLockScreenSettings() {
|
||||
backstack.push(NavTarget.LockScreenSettings)
|
||||
}
|
||||
|
||||
override fun onOpenAdvancedSettings() {
|
||||
override fun navigateToAdvancedSettings() {
|
||||
backstack.push(NavTarget.AdvancedSettings)
|
||||
}
|
||||
|
||||
override fun onOpenLabs() {
|
||||
override fun navigateToLabs() {
|
||||
backstack.push(NavTarget.Labs)
|
||||
}
|
||||
|
||||
override fun onOpenUserProfile(matrixUser: MatrixUser) {
|
||||
override fun navigateToUserProfile(matrixUser: MatrixUser) {
|
||||
backstack.push(NavTarget.UserProfile(matrixUser))
|
||||
}
|
||||
|
||||
override fun onOpenBlockedUsers() {
|
||||
override fun navigateToBlockedUsers() {
|
||||
backstack.push(NavTarget.BlockedUsers)
|
||||
}
|
||||
|
||||
override fun onSignOutClick() {
|
||||
override fun startSignOutFlow() {
|
||||
backstack.push(NavTarget.SignOut)
|
||||
}
|
||||
|
||||
override fun onOpenAccountDeactivation() {
|
||||
override fun startAccountDeactivationFlow() {
|
||||
backstack.push(NavTarget.AccountDeactivation)
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.DeveloperSettings -> {
|
||||
val developerSettingsCallback = object : DeveloperSettingsNode.Callback {
|
||||
override fun onPushHistoryClick() {
|
||||
override fun navigateToPushHistory() {
|
||||
backstack.push(NavTarget.PushHistory)
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.About -> {
|
||||
val callback = object : AboutNode.Callback {
|
||||
override fun openOssLicenses() {
|
||||
override fun navigateToOssLicenses() {
|
||||
backstack.push(NavTarget.OssLicenses)
|
||||
}
|
||||
}
|
||||
@@ -202,11 +202,11 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.NotificationSettings -> {
|
||||
val notificationSettingsCallback = object : NotificationSettingsNode.Callback {
|
||||
override fun editDefaultNotificationMode(isOneToOne: Boolean) {
|
||||
override fun navigateToEditDefaultNotificationSetting(isOneToOne: Boolean) {
|
||||
backstack.push(NavTarget.EditDefaultNotificationSetting(isOneToOne))
|
||||
}
|
||||
|
||||
override fun onTroubleshootNotificationsClick() {
|
||||
override fun navigateToTroubleshootNotifications() {
|
||||
backstack.push(NavTarget.TroubleshootNotifications)
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
}
|
||||
|
||||
override fun openIgnoredUsers() {
|
||||
override fun navigateToBlockedUsers() {
|
||||
backstack.push(NavTarget.BlockedUsers)
|
||||
}
|
||||
})
|
||||
@@ -240,16 +240,16 @@ class PreferencesFlowNode(
|
||||
}
|
||||
}
|
||||
|
||||
override fun navigateTo(roomId: RoomId, eventId: EventId) {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateTo(roomId, eventId) }
|
||||
override fun navigateToEvent(roomId: RoomId, eventId: EventId) {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToEvent(roomId, eventId) }
|
||||
}
|
||||
})
|
||||
.build()
|
||||
}
|
||||
is NavTarget.EditDefaultNotificationSetting -> {
|
||||
val callback = object : EditDefaultNotificationSettingNode.Callback {
|
||||
override fun openRoomNotificationSettings(roomId: RoomId) {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.onOpenRoomNotificationSettings(roomId) }
|
||||
override fun navigateToRoomNotificationSettings(roomId: RoomId) {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToRoomNotificationSettings(roomId) }
|
||||
}
|
||||
}
|
||||
val input = EditDefaultNotificationSettingNode.Inputs(navTarget.isOneToOne)
|
||||
@@ -270,8 +270,8 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.SignOut -> {
|
||||
val callBack: LogoutEntryPoint.Callback = object : LogoutEntryPoint.Callback {
|
||||
override fun onChangeRecoveryKeyClick() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.onSecureBackupClick() }
|
||||
override fun navigateToSecureBackup() {
|
||||
plugins<PreferencesEntryPoint.Callback>().forEach { it.navigateToSecureBackup() }
|
||||
}
|
||||
}
|
||||
logoutEntryPoint.nodeBuilder(this, buildContext)
|
||||
|
||||
@@ -29,7 +29,7 @@ class AboutNode(
|
||||
private val presenter: AboutPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun openOssLicenses()
|
||||
fun navigateToOssLicenses()
|
||||
}
|
||||
|
||||
private fun onElementLegalClick(
|
||||
@@ -52,7 +52,7 @@ class AboutNode(
|
||||
onElementLegalClick(activity, isDark, elementLegal)
|
||||
},
|
||||
onOpenSourceLicensesClick = {
|
||||
plugins.filterIsInstance<Callback>().forEach { it.openOssLicenses() }
|
||||
plugins.filterIsInstance<Callback>().forEach { it.navigateToOssLicenses() }
|
||||
},
|
||||
modifier = modifier
|
||||
)
|
||||
|
||||
@@ -29,13 +29,13 @@ class DeveloperSettingsNode(
|
||||
private val presenter: DeveloperSettingsPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onPushHistoryClick()
|
||||
fun navigateToPushHistory()
|
||||
}
|
||||
|
||||
private val callbacks = plugins<Callback>()
|
||||
|
||||
private fun onPushHistoryClick() {
|
||||
callbacks.forEach { it.onPushHistoryClick() }
|
||||
private fun navigateToPushHistory() {
|
||||
callbacks.forEach { it.navigateToPushHistory() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -51,7 +51,7 @@ class DeveloperSettingsNode(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onOpenShowkase = ::openShowkase,
|
||||
onPushHistoryClick = ::onPushHistoryClick,
|
||||
onPushHistoryClick = ::navigateToPushHistory,
|
||||
onBackClick = ::navigateUp
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@ class NotificationSettingsNode(
|
||||
private val presenter: NotificationSettingsPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun editDefaultNotificationMode(isOneToOne: Boolean)
|
||||
fun onTroubleshootNotificationsClick()
|
||||
fun navigateToEditDefaultNotificationSetting(isOneToOne: Boolean)
|
||||
fun navigateToTroubleshootNotifications()
|
||||
}
|
||||
|
||||
private val callbacks = plugins<Callback>()
|
||||
|
||||
private fun openEditDefault(isOneToOne: Boolean) {
|
||||
callbacks.forEach { it.editDefaultNotificationMode(isOneToOne) }
|
||||
private fun navigateToEditDefaultNotificationSetting(isOneToOne: Boolean) {
|
||||
callbacks.forEach { it.navigateToEditDefaultNotificationSetting(isOneToOne) }
|
||||
}
|
||||
|
||||
private fun onTroubleshootNotificationsClick() {
|
||||
callbacks.forEach { it.onTroubleshootNotificationsClick() }
|
||||
private fun navigateToTroubleshootNotifications() {
|
||||
callbacks.forEach { it.navigateToTroubleshootNotifications() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -45,9 +45,9 @@ class NotificationSettingsNode(
|
||||
val state = presenter.present()
|
||||
NotificationSettingsView(
|
||||
state = state,
|
||||
onOpenEditDefault = { openEditDefault(isOneToOne = it) },
|
||||
onOpenEditDefault = ::navigateToEditDefaultNotificationSetting,
|
||||
onBackClick = ::navigateUp,
|
||||
onTroubleshootNotificationsClick = ::onTroubleshootNotificationsClick,
|
||||
onTroubleshootNotificationsClick = ::navigateToTroubleshootNotifications,
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class EditDefaultNotificationSettingNode(
|
||||
presenterFactory: EditDefaultNotificationSettingPresenter.Factory
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun openRoomNotificationSettings(roomId: RoomId)
|
||||
fun navigateToRoomNotificationSettings(roomId: RoomId)
|
||||
}
|
||||
|
||||
data class Inputs(
|
||||
@@ -40,8 +40,8 @@ class EditDefaultNotificationSettingNode(
|
||||
private val callbacks = plugins<Callback>()
|
||||
private val presenter = presenterFactory.create(inputs.isOneToOne)
|
||||
|
||||
private fun openRoomNotificationSettings(roomId: RoomId) {
|
||||
callbacks.forEach { it.openRoomNotificationSettings(roomId) }
|
||||
private fun navigateToRoomNotificationSettings(roomId: RoomId) {
|
||||
callbacks.forEach { it.navigateToRoomNotificationSettings(roomId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -49,7 +49,7 @@ class EditDefaultNotificationSettingNode(
|
||||
val state = presenter.present()
|
||||
EditDefaultNotificationSettingView(
|
||||
state = state,
|
||||
openRoomNotificationSettings = { openRoomNotificationSettings(it) },
|
||||
openRoomNotificationSettings = { navigateToRoomNotificationSettings(it) },
|
||||
onBackClick = ::navigateUp,
|
||||
modifier = modifier,
|
||||
)
|
||||
|
||||
@@ -34,52 +34,52 @@ class PreferencesRootNode(
|
||||
private val directLogoutView: DirectLogoutView,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onAddAccount()
|
||||
fun onOpenBugReport()
|
||||
fun onSecureBackupClick()
|
||||
fun onOpenAnalytics()
|
||||
fun onOpenAbout()
|
||||
fun onOpenDeveloperSettings()
|
||||
fun onOpenNotificationSettings()
|
||||
fun onOpenLockScreenSettings()
|
||||
fun onOpenAdvancedSettings()
|
||||
fun onOpenLabs()
|
||||
fun onOpenUserProfile(matrixUser: MatrixUser)
|
||||
fun onOpenBlockedUsers()
|
||||
fun onSignOutClick()
|
||||
fun onOpenAccountDeactivation()
|
||||
fun navigateToAddAccount()
|
||||
fun navigateToBugReport()
|
||||
fun navigateToSecureBackup()
|
||||
fun navigateToAnalyticsSettings()
|
||||
fun navigateToAbout()
|
||||
fun navigateToDeveloperSettings()
|
||||
fun navigateToNotificationSettings()
|
||||
fun navigateToLockScreenSettings()
|
||||
fun navigateToAdvancedSettings()
|
||||
fun navigateToLabs()
|
||||
fun navigateToUserProfile(matrixUser: MatrixUser)
|
||||
fun navigateToBlockedUsers()
|
||||
fun startSignOutFlow()
|
||||
fun startAccountDeactivationFlow()
|
||||
}
|
||||
|
||||
private fun onAddAccount() {
|
||||
plugins<Callback>().forEach { it.onAddAccount() }
|
||||
plugins<Callback>().forEach { it.navigateToAddAccount() }
|
||||
}
|
||||
|
||||
private fun onOpenBugReport() {
|
||||
plugins<Callback>().forEach { it.onOpenBugReport() }
|
||||
plugins<Callback>().forEach { it.navigateToBugReport() }
|
||||
}
|
||||
|
||||
private fun onSecureBackupClick() {
|
||||
plugins<Callback>().forEach { it.onSecureBackupClick() }
|
||||
plugins<Callback>().forEach { it.navigateToSecureBackup() }
|
||||
}
|
||||
|
||||
private fun onOpenDeveloperSettings() {
|
||||
plugins<Callback>().forEach { it.onOpenDeveloperSettings() }
|
||||
plugins<Callback>().forEach { it.navigateToDeveloperSettings() }
|
||||
}
|
||||
|
||||
private fun onOpenAdvancedSettings() {
|
||||
plugins<Callback>().forEach { it.onOpenAdvancedSettings() }
|
||||
plugins<Callback>().forEach { it.navigateToAdvancedSettings() }
|
||||
}
|
||||
|
||||
private fun onOpenLabs() {
|
||||
plugins<Callback>().forEach { it.onOpenLabs() }
|
||||
plugins<Callback>().forEach { it.navigateToLabs() }
|
||||
}
|
||||
|
||||
private fun onOpenAnalytics() {
|
||||
plugins<Callback>().forEach { it.onOpenAnalytics() }
|
||||
plugins<Callback>().forEach { it.navigateToAnalyticsSettings() }
|
||||
}
|
||||
|
||||
private fun onOpenAbout() {
|
||||
plugins<Callback>().forEach { it.onOpenAbout() }
|
||||
plugins<Callback>().forEach { it.navigateToAbout() }
|
||||
}
|
||||
|
||||
private fun onManageAccountClick(
|
||||
@@ -97,27 +97,27 @@ class PreferencesRootNode(
|
||||
}
|
||||
|
||||
private fun onOpenNotificationSettings() {
|
||||
plugins<Callback>().forEach { it.onOpenNotificationSettings() }
|
||||
plugins<Callback>().forEach { it.navigateToNotificationSettings() }
|
||||
}
|
||||
|
||||
private fun onOpenLockScreenSettings() {
|
||||
plugins<Callback>().forEach { it.onOpenLockScreenSettings() }
|
||||
plugins<Callback>().forEach { it.navigateToLockScreenSettings() }
|
||||
}
|
||||
|
||||
private fun onOpenUserProfile(matrixUser: MatrixUser) {
|
||||
plugins<Callback>().forEach { it.onOpenUserProfile(matrixUser) }
|
||||
plugins<Callback>().forEach { it.navigateToUserProfile(matrixUser) }
|
||||
}
|
||||
|
||||
private fun onOpenBlockedUsers() {
|
||||
plugins<Callback>().forEach { it.onOpenBlockedUsers() }
|
||||
plugins<Callback>().forEach { it.navigateToBlockedUsers() }
|
||||
}
|
||||
|
||||
private fun onSignOutClick() {
|
||||
plugins<Callback>().forEach { it.onSignOutClick() }
|
||||
plugins<Callback>().forEach { it.startSignOutFlow() }
|
||||
}
|
||||
|
||||
private fun onOpenAccountDeactivation() {
|
||||
plugins<Callback>().forEach { it.onOpenAccountDeactivation() }
|
||||
plugins<Callback>().forEach { it.startAccountDeactivationFlow() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -63,11 +63,11 @@ class DefaultPreferencesEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : PreferencesEntryPoint.Callback {
|
||||
override fun onAddAccount() = lambdaError()
|
||||
override fun onOpenBugReport() = lambdaError()
|
||||
override fun onSecureBackupClick() = lambdaError()
|
||||
override fun onOpenRoomNotificationSettings(roomId: RoomId) = lambdaError()
|
||||
override fun navigateTo(roomId: RoomId, eventId: EventId) = lambdaError()
|
||||
override fun navigateToAddAccount() = lambdaError()
|
||||
override fun navigateToBugReport() = lambdaError()
|
||||
override fun navigateToSecureBackup() = lambdaError()
|
||||
override fun navigateToRoomNotificationSettings(roomId: RoomId) = lambdaError()
|
||||
override fun navigateToEvent(roomId: RoomId, eventId: EventId) = lambdaError()
|
||||
}
|
||||
val params = PreferencesEntryPoint.Params(
|
||||
initialElement = PreferencesEntryPoint.InitialTarget.NotificationSettings,
|
||||
|
||||
@@ -64,7 +64,7 @@ class BugReportFlowNode(
|
||||
this@BugReportFlowNode.onDone()
|
||||
}
|
||||
|
||||
override fun onViewLogs(basePath: String) {
|
||||
override fun navigateToViewLogs(basePath: String) {
|
||||
backstack.push(NavTarget.ViewLogs(rootPath = basePath))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ class BugReportNode(
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onDone()
|
||||
fun onViewLogs(basePath: String)
|
||||
fun navigateToViewLogs(basePath: String)
|
||||
}
|
||||
|
||||
private fun onViewLogs(basePath: String) {
|
||||
plugins<Callback>().forEach { it.onViewLogs(basePath) }
|
||||
plugins<Callback>().forEach { it.navigateToViewLogs(basePath) }
|
||||
}
|
||||
|
||||
private fun onDone() {
|
||||
|
||||
@@ -37,10 +37,10 @@ interface RoomDetailsEntryPoint : FeatureEntryPoint {
|
||||
data class Params(val initialElement: InitialTarget) : NodeInputs
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenGlobalNotificationSettings()
|
||||
fun onOpenRoom(roomId: RoomId, serverNames: List<String>)
|
||||
fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
fun navigateToGlobalNotificationSettings()
|
||||
fun navigateToRoom(roomId: RoomId, serverNames: List<String>)
|
||||
fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean)
|
||||
fun startForwardEventFlow(eventId: EventId)
|
||||
}
|
||||
|
||||
interface NodeBuilder {
|
||||
|
||||
@@ -167,55 +167,55 @@ class RoomDetailsFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.RoomDetails -> {
|
||||
val roomDetailsCallback = object : RoomDetailsNode.Callback {
|
||||
override fun openRoomMemberList() {
|
||||
override fun navigateToRoomMemberList() {
|
||||
backstack.push(NavTarget.RoomMemberList)
|
||||
}
|
||||
|
||||
override fun editRoomDetails() {
|
||||
override fun navigateToRoomDetailsEdit() {
|
||||
backstack.push(NavTarget.RoomDetailsEdit)
|
||||
}
|
||||
|
||||
override fun openInviteMembers() {
|
||||
override fun navigateToInviteMembers() {
|
||||
backstack.push(NavTarget.InviteMembers)
|
||||
}
|
||||
|
||||
override fun openRoomNotificationSettings() {
|
||||
override fun navigateToRoomNotificationSettings() {
|
||||
backstack.push(NavTarget.RoomNotificationSettings(showUserDefinedSettingStyle = false))
|
||||
}
|
||||
|
||||
override fun openAvatarPreview(name: String, url: String) {
|
||||
override fun navigateToAvatarPreview(name: String, url: String) {
|
||||
overlay.show(NavTarget.AvatarPreview(name, url))
|
||||
}
|
||||
|
||||
override fun openPollHistory() {
|
||||
override fun navigateToPollHistory() {
|
||||
backstack.push(NavTarget.PollHistory)
|
||||
}
|
||||
|
||||
override fun openMediaGallery() {
|
||||
override fun navigateToMediaGallery() {
|
||||
backstack.push(NavTarget.MediaGallery)
|
||||
}
|
||||
|
||||
override fun openAdminSettings() {
|
||||
override fun navigateToAdminSettings() {
|
||||
backstack.push(NavTarget.AdminSettings)
|
||||
}
|
||||
|
||||
override fun openPinnedMessagesList() {
|
||||
override fun navigateToPinnedMessagesList() {
|
||||
backstack.push(NavTarget.PinnedMessagesList)
|
||||
}
|
||||
|
||||
override fun openKnockRequestsList() {
|
||||
override fun navigateToKnockRequestsList() {
|
||||
backstack.push(NavTarget.KnockRequestsList)
|
||||
}
|
||||
|
||||
override fun openSecurityAndPrivacy() {
|
||||
override fun navigateToSecurityAndPrivacy() {
|
||||
backstack.push(NavTarget.SecurityAndPrivacy)
|
||||
}
|
||||
|
||||
override fun openDmUserProfile(userId: UserId) {
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) {
|
||||
backstack.push(NavTarget.RoomMemberDetails(userId))
|
||||
}
|
||||
|
||||
override fun onJoinCall() {
|
||||
override fun navigateToRoomCall() {
|
||||
val inputs = CallType.RoomCall(
|
||||
sessionId = room.sessionId,
|
||||
roomId = room.roomId,
|
||||
@@ -224,11 +224,11 @@ class RoomDetailsFlowNode(
|
||||
elementCallEntryPoint.startCall(inputs)
|
||||
}
|
||||
|
||||
override fun openReportRoom() {
|
||||
override fun navigateToReportRoom() {
|
||||
backstack.push(NavTarget.ReportRoom)
|
||||
}
|
||||
|
||||
override fun onSelectNewOwnersWhenLeaving() {
|
||||
override fun navigateToSelectNewOwnersWhenLeaving() {
|
||||
backstack.push(NavTarget.SelectNewOwnersWhenLeaving)
|
||||
}
|
||||
}
|
||||
@@ -237,11 +237,11 @@ class RoomDetailsFlowNode(
|
||||
|
||||
NavTarget.RoomMemberList -> {
|
||||
val roomMemberListCallback = object : RoomMemberListNode.Callback {
|
||||
override fun openRoomMemberDetails(roomMemberId: UserId) {
|
||||
override fun navigateToRoomMemberDetails(roomMemberId: UserId) {
|
||||
backstack.push(NavTarget.RoomMemberDetails(roomMemberId))
|
||||
}
|
||||
|
||||
override fun openInviteMembers() {
|
||||
override fun navigateToInviteMembers() {
|
||||
backstack.push(NavTarget.InviteMembers)
|
||||
}
|
||||
}
|
||||
@@ -259,8 +259,8 @@ class RoomDetailsFlowNode(
|
||||
is NavTarget.RoomNotificationSettings -> {
|
||||
val input = RoomNotificationSettingsNode.RoomNotificationSettingInput(navTarget.showUserDefinedSettingStyle)
|
||||
val callback = object : RoomNotificationSettingsNode.Callback {
|
||||
override fun openGlobalNotificationSettings() {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.onOpenGlobalNotificationSettings() }
|
||||
override fun navigateToGlobalNotificationSettings() {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.navigateToGlobalNotificationSettings() }
|
||||
}
|
||||
}
|
||||
createNode<RoomNotificationSettingsNode>(buildContext, listOf(input, callback))
|
||||
@@ -268,19 +268,19 @@ class RoomDetailsFlowNode(
|
||||
|
||||
is NavTarget.RoomMemberDetails -> {
|
||||
val callback = object : UserProfileNodeHelper.Callback {
|
||||
override fun openAvatarPreview(username: String, avatarUrl: String) {
|
||||
override fun navigateToAvatarPreview(username: String, avatarUrl: String) {
|
||||
overlay.show(NavTarget.AvatarPreview(username, avatarUrl))
|
||||
}
|
||||
|
||||
override fun onStartDM(roomId: RoomId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.onOpenRoom(roomId, emptyList()) }
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.navigateToRoom(roomId, emptyList()) }
|
||||
}
|
||||
|
||||
override fun onStartCall(dmRoomId: RoomId) {
|
||||
override fun startCall(dmRoomId: RoomId) {
|
||||
elementCallEntryPoint.startCall(CallType.RoomCall(roomId = dmRoomId, sessionId = room.sessionId))
|
||||
}
|
||||
|
||||
override fun onVerifyUser(userId: UserId) {
|
||||
override fun startVerifyUserFlow(userId: UserId) {
|
||||
backstack.push(NavTarget.VerifyUser(userId))
|
||||
}
|
||||
}
|
||||
@@ -293,11 +293,11 @@ class RoomDetailsFlowNode(
|
||||
overlay.hide()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
// Cannot happen
|
||||
}
|
||||
|
||||
override fun onForwardEvent(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
// Cannot happen
|
||||
}
|
||||
}
|
||||
@@ -318,18 +318,18 @@ class RoomDetailsFlowNode(
|
||||
backstack.pop()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
val permalinkData = PermalinkData.RoomLink(
|
||||
roomIdOrAlias = room.roomId.toRoomIdOrAlias(),
|
||||
eventId = eventId,
|
||||
)
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach {
|
||||
it.onPermalinkClick(permalinkData, pushToBackstack = false)
|
||||
it.handlePermalinkClick(permalinkData, pushToBackstack = false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.forwardEvent(eventId) }
|
||||
override fun forward(eventId: EventId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.startForwardEventFlow(eventId) }
|
||||
}
|
||||
}
|
||||
mediaGalleryEntryPoint.nodeBuilder(this, buildContext)
|
||||
@@ -345,20 +345,20 @@ class RoomDetailsFlowNode(
|
||||
MessagesEntryPoint.InitialTarget.PinnedMessages
|
||||
)
|
||||
val callback = object : MessagesEntryPoint.Callback {
|
||||
override fun onRoomDetailsClick() = Unit
|
||||
override fun navigateToRoomDetails() = Unit
|
||||
|
||||
override fun onUserDataClick(userId: UserId) = Unit
|
||||
override fun navigateToRoomMemberDetails(userId: UserId) = Unit
|
||||
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.onPermalinkClick(data, pushToBackstack) }
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.handlePermalinkClick(data, pushToBackstack) }
|
||||
}
|
||||
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.forwardEvent(eventId) }
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.startForwardEventFlow(eventId) }
|
||||
}
|
||||
|
||||
override fun openRoom(roomId: RoomId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.onOpenRoom(roomId, emptyList()) }
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
plugins<RoomDetailsEntryPoint.Callback>().forEach { it.navigateToRoom(roomId, emptyList()) }
|
||||
}
|
||||
}
|
||||
return messagesEntryPoint.nodeBuilder(this, buildContext)
|
||||
@@ -388,7 +388,7 @@ class RoomDetailsFlowNode(
|
||||
backstack.pop()
|
||||
}
|
||||
|
||||
override fun onLearnMoreAboutEncryption() {
|
||||
override fun navigateToLearnMoreAboutEncryption() {
|
||||
learnMoreUrl.value = LearnMoreConfig.ENCRYPTION_URL
|
||||
}
|
||||
})
|
||||
|
||||
@@ -46,21 +46,21 @@ class RoomDetailsNode(
|
||||
private val leaveRoomRenderer: LeaveRoomRenderer,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun openRoomMemberList()
|
||||
fun openInviteMembers()
|
||||
fun editRoomDetails()
|
||||
fun openRoomNotificationSettings()
|
||||
fun openAvatarPreview(name: String, url: String)
|
||||
fun openPollHistory()
|
||||
fun openMediaGallery()
|
||||
fun openAdminSettings()
|
||||
fun openPinnedMessagesList()
|
||||
fun openKnockRequestsList()
|
||||
fun openSecurityAndPrivacy()
|
||||
fun openDmUserProfile(userId: UserId)
|
||||
fun onJoinCall()
|
||||
fun openReportRoom()
|
||||
fun onSelectNewOwnersWhenLeaving()
|
||||
fun navigateToRoomMemberList()
|
||||
fun navigateToInviteMembers()
|
||||
fun navigateToRoomDetailsEdit()
|
||||
fun navigateToRoomNotificationSettings()
|
||||
fun navigateToAvatarPreview(name: String, url: String)
|
||||
fun navigateToPollHistory()
|
||||
fun navigateToMediaGallery()
|
||||
fun navigateToAdminSettings()
|
||||
fun navigateToPinnedMessagesList()
|
||||
fun navigateToKnockRequestsList()
|
||||
fun navigateToSecurityAndPrivacy()
|
||||
fun navigateToRoomMemberDetails(userId: UserId)
|
||||
fun navigateToRoomCall()
|
||||
fun navigateToReportRoom()
|
||||
fun navigateToSelectNewOwnersWhenLeaving()
|
||||
}
|
||||
|
||||
private val callback = plugins<Callback>().first()
|
||||
@@ -74,27 +74,27 @@ class RoomDetailsNode(
|
||||
}
|
||||
|
||||
private fun openRoomMemberList() {
|
||||
callback.openRoomMemberList()
|
||||
callback.navigateToRoomMemberList()
|
||||
}
|
||||
|
||||
private fun openRoomNotificationSettings() {
|
||||
callback.openRoomNotificationSettings()
|
||||
callback.navigateToRoomNotificationSettings()
|
||||
}
|
||||
|
||||
private fun invitePeople() {
|
||||
callback.openInviteMembers()
|
||||
callback.navigateToInviteMembers()
|
||||
}
|
||||
|
||||
private fun openPollHistory() {
|
||||
callback.openPollHistory()
|
||||
callback.navigateToPollHistory()
|
||||
}
|
||||
|
||||
private fun openMediaGallery() {
|
||||
callback.openMediaGallery()
|
||||
callback.navigateToMediaGallery()
|
||||
}
|
||||
|
||||
private fun onJoinCall() {
|
||||
callback.onJoinCall()
|
||||
callback.navigateToRoomCall()
|
||||
}
|
||||
|
||||
private fun CoroutineScope.onShareRoom(context: Context) = launch {
|
||||
@@ -113,39 +113,39 @@ class RoomDetailsNode(
|
||||
}
|
||||
|
||||
private fun onEditRoomDetails() {
|
||||
callback.editRoomDetails()
|
||||
callback.navigateToRoomDetailsEdit()
|
||||
}
|
||||
|
||||
private fun openAvatarPreview(name: String, url: String) {
|
||||
callback.openAvatarPreview(name, url)
|
||||
callback.navigateToAvatarPreview(name, url)
|
||||
}
|
||||
|
||||
private fun openAdminSettings() {
|
||||
callback.openAdminSettings()
|
||||
callback.navigateToAdminSettings()
|
||||
}
|
||||
|
||||
private fun openPinnedMessages() {
|
||||
callback.openPinnedMessagesList()
|
||||
callback.navigateToPinnedMessagesList()
|
||||
}
|
||||
|
||||
private fun openKnockRequestsLists() {
|
||||
callback.openKnockRequestsList()
|
||||
callback.navigateToKnockRequestsList()
|
||||
}
|
||||
|
||||
private fun openSecurityAndPrivacy() {
|
||||
callback.openSecurityAndPrivacy()
|
||||
callback.navigateToSecurityAndPrivacy()
|
||||
}
|
||||
|
||||
private fun onProfileClick(userId: UserId) {
|
||||
callback.openDmUserProfile(userId)
|
||||
callback.navigateToRoomMemberDetails(userId)
|
||||
}
|
||||
|
||||
private fun onReportRoomClick() {
|
||||
callback.openReportRoom()
|
||||
callback.navigateToReportRoom()
|
||||
}
|
||||
|
||||
private fun onSelectNewOwnersWhenLeaving() {
|
||||
return callback.onSelectNewOwnersWhenLeaving()
|
||||
return callback.navigateToSelectNewOwnersWhenLeaving()
|
||||
}
|
||||
|
||||
private val stateFlow = launchMolecule { presenter.present() }
|
||||
|
||||
@@ -35,8 +35,8 @@ class RoomMemberListNode(
|
||||
private val roomMemberModerationRenderer: RoomMemberModerationRenderer,
|
||||
) : Node(buildContext, plugins = plugins), RoomMemberListNavigator {
|
||||
interface Callback : Plugin {
|
||||
fun openRoomMemberDetails(roomMemberId: UserId)
|
||||
fun openInviteMembers()
|
||||
fun navigateToRoomMemberDetails(roomMemberId: UserId)
|
||||
fun navigateToInviteMembers()
|
||||
}
|
||||
|
||||
private val callbacks = plugins<Callback>()
|
||||
@@ -51,13 +51,13 @@ class RoomMemberListNode(
|
||||
|
||||
override fun openRoomMemberDetails(roomMemberId: UserId) {
|
||||
callbacks.forEach {
|
||||
it.openRoomMemberDetails(roomMemberId)
|
||||
it.navigateToRoomMemberDetails(roomMemberId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun openInviteMembers() {
|
||||
callbacks.forEach {
|
||||
it.openInviteMembers()
|
||||
it.navigateToInviteMembers()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,12 +62,12 @@ class RoomMemberDetailsNode(
|
||||
userProfileNodeHelper.onShareUser(context, permalinkBuilder)
|
||||
}
|
||||
|
||||
fun onStartDM(roomId: RoomId) {
|
||||
callback.onStartDM(roomId)
|
||||
fun navigateToRoom(roomId: RoomId) {
|
||||
callback.navigateToRoom(roomId)
|
||||
}
|
||||
|
||||
fun onStartCall(roomId: RoomId) {
|
||||
callback.onStartCall(roomId)
|
||||
callback.startCall(roomId)
|
||||
}
|
||||
|
||||
val state = presenter.present()
|
||||
@@ -77,10 +77,10 @@ class RoomMemberDetailsNode(
|
||||
modifier = modifier,
|
||||
goBack = this::navigateUp,
|
||||
onShareUser = ::onShareUser,
|
||||
onOpenDm = ::onStartDM,
|
||||
onOpenDm = ::navigateToRoom,
|
||||
onStartCall = ::onStartCall,
|
||||
openAvatarPreview = callback::openAvatarPreview,
|
||||
onVerifyClick = callback::onVerifyUser,
|
||||
openAvatarPreview = callback::navigateToAvatarPreview,
|
||||
onVerifyClick = callback::startVerifyUserFlow,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ class RoomNotificationSettingsNode(
|
||||
val showUserDefinedSettingStyle: Boolean
|
||||
) : NodeInputs
|
||||
interface Callback : Plugin {
|
||||
fun openGlobalNotificationSettings()
|
||||
fun navigateToGlobalNotificationSettings()
|
||||
}
|
||||
private val inputs = inputs<RoomNotificationSettingInput>()
|
||||
private val callbacks = plugins<Callback>()
|
||||
|
||||
private fun openGlobalNotificationSettings() {
|
||||
callbacks.forEach { it.openGlobalNotificationSettings() }
|
||||
private fun navigateToGlobalNotificationSettings() {
|
||||
callbacks.forEach { it.navigateToGlobalNotificationSettings() }
|
||||
}
|
||||
|
||||
private val presenter = presenterFactory.create(inputs.showUserDefinedSettingStyle)
|
||||
@@ -59,7 +59,7 @@ class RoomNotificationSettingsNode(
|
||||
RoomNotificationSettingsView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onShowGlobalNotifications = this::openGlobalNotificationSettings,
|
||||
onShowGlobalNotifications = this::navigateToGlobalNotificationSettings,
|
||||
onBackClick = this::navigateUp,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ class DefaultRoomDetailsEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : RoomDetailsEntryPoint.Callback {
|
||||
override fun onOpenGlobalNotificationSettings() = lambdaError()
|
||||
override fun onOpenRoom(roomId: RoomId, serverNames: List<String>) = lambdaError()
|
||||
override fun onPermalinkClick(data: PermalinkData, pushToBackstack: Boolean) = lambdaError()
|
||||
override fun forwardEvent(eventId: EventId) = lambdaError()
|
||||
override fun navigateToGlobalNotificationSettings() = lambdaError()
|
||||
override fun navigateToRoom(roomId: RoomId, serverNames: List<String>) = lambdaError()
|
||||
override fun handlePermalinkClick(data: PermalinkData, pushToBackstack: Boolean) = lambdaError()
|
||||
override fun startForwardEventFlow(eventId: EventId) = lambdaError()
|
||||
}
|
||||
val params = RoomDetailsEntryPoint.Params(
|
||||
initialElement = RoomDetailsEntryPoint.InitialTarget.RoomDetails,
|
||||
|
||||
@@ -21,6 +21,6 @@ interface RoomDirectoryEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onResultClick(roomDescription: RoomDescription)
|
||||
fun navigateToRoom(roomDescription: RoomDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class RoomDirectoryNode(
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
private fun onResultClick(roomDescription: RoomDescription) {
|
||||
plugins<RoomDirectoryEntryPoint.Callback>().forEach {
|
||||
it.onResultClick(roomDescription)
|
||||
it.navigateToRoom(roomDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class DefaultRoomDirectoryEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : RoomDirectoryEntryPoint.Callback {
|
||||
override fun onResultClick(roomDescription: RoomDescription) = lambdaError()
|
||||
override fun navigateToRoom(roomDescription: RoomDescription) = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.callback(callback)
|
||||
|
||||
@@ -77,19 +77,19 @@ class SecureBackupFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.Root -> {
|
||||
val callback = object : SecureBackupRootNode.Callback {
|
||||
override fun onSetupClick() {
|
||||
override fun navigateToSetup() {
|
||||
backstack.push(NavTarget.Setup)
|
||||
}
|
||||
|
||||
override fun onChangeClick() {
|
||||
override fun navigateToChange() {
|
||||
backstack.push(NavTarget.Change)
|
||||
}
|
||||
|
||||
override fun onDisableClick() {
|
||||
override fun navigateToDisable() {
|
||||
backstack.push(NavTarget.Disable)
|
||||
}
|
||||
|
||||
override fun onConfirmRecoveryKeyClick() {
|
||||
override fun navigateToEnterRecoveryKey() {
|
||||
backstack.push(NavTarget.EnterRecoveryKey)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,26 +32,26 @@ class SecureBackupRootNode(
|
||||
plugins = plugins
|
||||
) {
|
||||
interface Callback : Plugin {
|
||||
fun onSetupClick()
|
||||
fun onChangeClick()
|
||||
fun onDisableClick()
|
||||
fun onConfirmRecoveryKeyClick()
|
||||
fun navigateToSetup()
|
||||
fun navigateToChange()
|
||||
fun navigateToDisable()
|
||||
fun navigateToEnterRecoveryKey()
|
||||
}
|
||||
|
||||
private fun onSetupClick() {
|
||||
plugins<Callback>().forEach { it.onSetupClick() }
|
||||
plugins<Callback>().forEach { it.navigateToSetup() }
|
||||
}
|
||||
|
||||
private fun onChangeClick() {
|
||||
plugins<Callback>().forEach { it.onChangeClick() }
|
||||
plugins<Callback>().forEach { it.navigateToChange() }
|
||||
}
|
||||
|
||||
private fun onDisableClick() {
|
||||
plugins<Callback>().forEach { it.onDisableClick() }
|
||||
plugins<Callback>().forEach { it.navigateToDisable() }
|
||||
}
|
||||
|
||||
private fun onConfirmRecoveryKeyClick() {
|
||||
plugins<Callback>().forEach { it.onConfirmRecoveryKeyClick() }
|
||||
plugins<Callback>().forEach { it.navigateToEnterRecoveryKey() }
|
||||
}
|
||||
|
||||
private fun onLearnMoreClick(uriHandler: UriHandler) {
|
||||
|
||||
@@ -31,9 +31,8 @@ interface SpaceEntryPoint : FeatureEntryPoint {
|
||||
) : NodeInputs
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomId: RoomId, viaParameters: List<String>)
|
||||
fun onOpenDetails()
|
||||
|
||||
fun onOpenMemberList()
|
||||
fun navigateToRoom(roomId: RoomId, viaParameters: List<String>)
|
||||
fun navigateToRoomDetails()
|
||||
fun navigateToRoomMemberList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,19 +80,19 @@ class SpaceFlowNode(
|
||||
}
|
||||
NavTarget.Root -> {
|
||||
val callback = object : SpaceNode.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId, viaParameters: List<String>) {
|
||||
callback.onOpenRoom(roomId, viaParameters)
|
||||
override fun navigateToRoom(roomId: RoomId, viaParameters: List<String>) {
|
||||
callback.navigateToRoom(roomId, viaParameters)
|
||||
}
|
||||
|
||||
override fun onOpenDetails() {
|
||||
callback.onOpenDetails()
|
||||
override fun navigateToRoomDetails() {
|
||||
callback.navigateToRoomDetails()
|
||||
}
|
||||
|
||||
override fun onOpenMemberList() {
|
||||
callback.onOpenMemberList()
|
||||
callback.navigateToRoomMemberList()
|
||||
}
|
||||
|
||||
override fun onLeaveSpace() {
|
||||
override fun startLeaveSpaceFlow() {
|
||||
backstack.push(NavTarget.Leave)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,10 @@ class SpaceNode(
|
||||
private val acceptDeclineInviteView: AcceptDeclineInviteView,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomId: RoomId, viaParameters: List<String>)
|
||||
fun onOpenDetails()
|
||||
|
||||
fun navigateToRoom(roomId: RoomId, viaParameters: List<String>)
|
||||
fun navigateToRoomDetails()
|
||||
fun onOpenMemberList()
|
||||
fun onLeaveSpace()
|
||||
fun startLeaveSpaceFlow()
|
||||
}
|
||||
|
||||
private val callback = plugins.filterIsInstance<Callback>().single()
|
||||
@@ -74,13 +73,13 @@ class SpaceNode(
|
||||
state = state,
|
||||
onBackClick = ::navigateUp,
|
||||
onLeaveSpaceClick = {
|
||||
callback.onLeaveSpace()
|
||||
callback.startLeaveSpaceFlow()
|
||||
},
|
||||
onRoomClick = { spaceRoom ->
|
||||
callback.onOpenRoom(spaceRoom.roomId, spaceRoom.via)
|
||||
callback.navigateToRoom(spaceRoom.roomId, spaceRoom.via)
|
||||
},
|
||||
onDetailsClick = {
|
||||
callback.onOpenDetails()
|
||||
callback.navigateToRoomDetails()
|
||||
},
|
||||
onShareSpace = {
|
||||
onShareRoom(context)
|
||||
@@ -92,7 +91,7 @@ class SpaceNode(
|
||||
acceptDeclineInviteView.Render(
|
||||
state = state.acceptDeclineInviteState,
|
||||
onAcceptInviteSuccess = { roomId ->
|
||||
callback.onOpenRoom(roomId, emptyList())
|
||||
callback.navigateToRoom(roomId, emptyList())
|
||||
},
|
||||
onDeclineInviteSuccess = { roomId ->
|
||||
// No action needed
|
||||
|
||||
@@ -44,9 +44,9 @@ class DefaultSpaceEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : SpaceEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId, viaParameters: List<String>) = lambdaError()
|
||||
override fun onOpenDetails() = lambdaError()
|
||||
override fun onOpenMemberList() = lambdaError()
|
||||
override fun navigateToRoom(roomId: RoomId, viaParameters: List<String>) = lambdaError()
|
||||
override fun navigateToRoomDetails() = lambdaError()
|
||||
override fun navigateToRoomMemberList() = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.inputs(nodeInputs)
|
||||
|
||||
@@ -21,7 +21,7 @@ interface StartChatEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>)
|
||||
fun onOpenRoomDirectory()
|
||||
fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>)
|
||||
fun navigateToRoomDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.overlay.operation.show
|
||||
import io.element.android.libraries.matrix.api.core.RoomIdOrAlias
|
||||
|
||||
interface StartChatNavigator : Plugin {
|
||||
fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>)
|
||||
fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>)
|
||||
fun onCreateNewRoom()
|
||||
fun onShowJoinRoomByAddress()
|
||||
fun onDismissJoinRoomByAddress()
|
||||
@@ -30,7 +30,8 @@ class DefaultStartChatNavigator(
|
||||
private val openRoom: (RoomIdOrAlias, List<String>) -> Unit,
|
||||
private val openRoomDirectory: () -> Unit,
|
||||
) : StartChatNavigator {
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) = openRoom(roomIdOrAlias, serverNames)
|
||||
override fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) =
|
||||
openRoom(roomIdOrAlias, serverNames)
|
||||
|
||||
override fun onOpenRoomDirectory() = openRoomDirectory()
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ class StartChatFlowNode(
|
||||
backstack = backstack,
|
||||
overlay = overlay,
|
||||
openRoom = { roomIdOrAlias, viaServers ->
|
||||
plugins<StartChatEntryPoint.Callback>().forEach { it.onOpenRoom(roomIdOrAlias, viaServers) }
|
||||
plugins<StartChatEntryPoint.Callback>().forEach { it.onRoomCreated(roomIdOrAlias, viaServers) }
|
||||
},
|
||||
openRoomDirectory = {
|
||||
plugins<StartChatEntryPoint.Callback>().forEach { it.onOpenRoomDirectory() }
|
||||
plugins<StartChatEntryPoint.Callback>().forEach { it.navigateToRoomDirectory() }
|
||||
}
|
||||
)
|
||||
|
||||
@@ -79,7 +79,7 @@ class StartChatFlowNode(
|
||||
NavTarget.NewRoom -> {
|
||||
val callback = object : CreateRoomEntryPoint.Callback {
|
||||
override fun onRoomCreated(roomId: RoomId) {
|
||||
navigator.onOpenRoom(roomId.toRoomIdOrAlias(), emptyList())
|
||||
navigator.onRoomCreated(roomId.toRoomIdOrAlias(), emptyList())
|
||||
}
|
||||
}
|
||||
createRoomEntryPoint.nodeBuilder(parentNode = this, buildContext = buildContext)
|
||||
|
||||
@@ -94,7 +94,7 @@ class JoinRoomByAddressPresenter(
|
||||
|
||||
private fun onRoomFound(state: RoomAddressState.RoomFound) {
|
||||
navigator.onDismissJoinRoomByAddress()
|
||||
navigator.onOpenRoom(
|
||||
navigator.onRoomCreated(
|
||||
roomIdOrAlias = state.resolved.roomId.toRoomIdOrAlias(),
|
||||
serverNames = state.resolved.servers
|
||||
)
|
||||
|
||||
@@ -53,7 +53,7 @@ class StartChatNode(
|
||||
onCloseClick = this::navigateUp,
|
||||
onNewRoomClick = navigator::onCreateNewRoom,
|
||||
onOpenDM = {
|
||||
navigator.onOpenRoom(roomIdOrAlias = it.toRoomIdOrAlias(), serverNames = emptyList())
|
||||
navigator.onRoomCreated(roomIdOrAlias = it.toRoomIdOrAlias(), serverNames = emptyList())
|
||||
},
|
||||
onJoinByAddressClick = navigator::onShowJoinRoomByAddress,
|
||||
onInviteFriendsClick = { invitePeople(activity) },
|
||||
|
||||
@@ -40,8 +40,8 @@ class DefaultStartChatEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : StartChatEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) = lambdaError()
|
||||
override fun onOpenRoomDirectory() = lambdaError()
|
||||
override fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) = lambdaError()
|
||||
override fun navigateToRoomDirectory() = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.callback(callback)
|
||||
|
||||
@@ -17,7 +17,7 @@ class FakeStartChatNavigator(
|
||||
private val dismissJoinRoomByAddressLambda: () -> Unit = {},
|
||||
private val openRoomDirectoryLambda: () -> Unit = {},
|
||||
) : StartChatNavigator {
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) {
|
||||
override fun onRoomCreated(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) {
|
||||
openRoomLambda(roomIdOrAlias, serverNames)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ interface UserProfileEntryPoint : FeatureEntryPoint {
|
||||
data class Params(val userId: UserId) : NodeInputs
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomId: RoomId)
|
||||
fun navigateToRoom(roomId: RoomId)
|
||||
}
|
||||
|
||||
interface NodeBuilder {
|
||||
|
||||
@@ -73,19 +73,19 @@ class UserProfileFlowNode(
|
||||
return when (navTarget) {
|
||||
NavTarget.Root -> {
|
||||
val callback = object : UserProfileNodeHelper.Callback {
|
||||
override fun openAvatarPreview(username: String, avatarUrl: String) {
|
||||
override fun navigateToAvatarPreview(username: String, avatarUrl: String) {
|
||||
backstack.push(NavTarget.AvatarPreview(username, avatarUrl))
|
||||
}
|
||||
|
||||
override fun onStartDM(roomId: RoomId) {
|
||||
plugins<UserProfileEntryPoint.Callback>().forEach { it.onOpenRoom(roomId) }
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
plugins<UserProfileEntryPoint.Callback>().forEach { it.navigateToRoom(roomId) }
|
||||
}
|
||||
|
||||
override fun onStartCall(dmRoomId: RoomId) {
|
||||
override fun startCall(dmRoomId: RoomId) {
|
||||
elementCallEntryPoint.startCall(CallType.RoomCall(sessionId = sessionId, roomId = dmRoomId))
|
||||
}
|
||||
|
||||
override fun onVerifyUser(userId: UserId) {
|
||||
override fun startVerifyUserFlow(userId: UserId) {
|
||||
backstack.push(NavTarget.VerifyUser(userId))
|
||||
}
|
||||
}
|
||||
@@ -98,11 +98,11 @@ class UserProfileFlowNode(
|
||||
backstack.pop()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
// Cannot happen
|
||||
}
|
||||
|
||||
override fun onForwardEvent(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
// Cannot happen
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class UserProfileNode(
|
||||
}
|
||||
|
||||
fun onStartDM(roomId: RoomId) {
|
||||
callback.onStartDM(roomId)
|
||||
callback.navigateToRoom(roomId)
|
||||
}
|
||||
|
||||
val state = presenter.present()
|
||||
@@ -74,9 +74,9 @@ class UserProfileNode(
|
||||
goBack = this::navigateUp,
|
||||
onShareUser = ::onShareUser,
|
||||
onOpenDm = ::onStartDM,
|
||||
onStartCall = callback::onStartCall,
|
||||
openAvatarPreview = callback::openAvatarPreview,
|
||||
onVerifyClick = callback::onVerifyUser,
|
||||
onStartCall = callback::startCall,
|
||||
openAvatarPreview = callback::navigateToAvatarPreview,
|
||||
onVerifyClick = callback::startVerifyUserFlow,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class DefaultUserProfileEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : UserProfileEntryPoint.Callback {
|
||||
override fun onOpenRoom(roomId: RoomId) {
|
||||
override fun navigateToRoom(roomId: RoomId) {
|
||||
lambdaError()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ class UserProfileNodeHelper(
|
||||
private val userId: UserId,
|
||||
) {
|
||||
interface Callback : NodeInputs {
|
||||
fun openAvatarPreview(username: String, avatarUrl: String)
|
||||
fun onStartDM(roomId: RoomId)
|
||||
fun onStartCall(dmRoomId: RoomId)
|
||||
fun onVerifyUser(userId: UserId)
|
||||
fun navigateToAvatarPreview(username: String, avatarUrl: String)
|
||||
fun navigateToRoom(roomId: RoomId)
|
||||
fun startCall(dmRoomId: RoomId)
|
||||
fun startVerifyUserFlow(userId: UserId)
|
||||
}
|
||||
|
||||
fun onShareUser(
|
||||
|
||||
@@ -29,7 +29,7 @@ interface OutgoingVerificationEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onLearnMoreAboutEncryption()
|
||||
fun navigateToLearnMoreAboutEncryption()
|
||||
fun onBack()
|
||||
fun onDone()
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class OutgoingVerificationNode(
|
||||
OutgoingVerificationView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onLearnMoreClick = callback::onLearnMoreAboutEncryption,
|
||||
onLearnMoreClick = callback::navigateToLearnMoreAboutEncryption,
|
||||
onFinish = callback::onDone,
|
||||
onBack = callback::onBack,
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ class DefaultOutgoingVerificationEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : OutgoingVerificationEntryPoint.Callback {
|
||||
override fun onLearnMoreAboutEncryption() = lambdaError()
|
||||
override fun navigateToLearnMoreAboutEncryption() = lambdaError()
|
||||
override fun onBack() = lambdaError()
|
||||
override fun onDone() = lambdaError()
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class ViewFolderNode(
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onBackClick()
|
||||
fun onNavigateTo(item: Item)
|
||||
fun navigateToItem(item: Item)
|
||||
}
|
||||
|
||||
private val inputs: Inputs = inputs()
|
||||
@@ -50,7 +50,7 @@ class ViewFolderNode(
|
||||
}
|
||||
|
||||
private fun onNavigateTo(item: Item) {
|
||||
plugins<Callback>().forEach { it.onNavigateTo(item) }
|
||||
plugins<Callback>().forEach { it.navigateToItem(item) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -111,7 +111,7 @@ class ViewFolderFlowNode(
|
||||
onDone()
|
||||
}
|
||||
|
||||
override fun onNavigateTo(item: Item) {
|
||||
override fun navigateToItem(item: Item) {
|
||||
when (item) {
|
||||
Item.Parent -> {
|
||||
// Should not happen when in Root since parent is not accessible from root (canGoUp set to false)
|
||||
|
||||
@@ -22,7 +22,7 @@ interface AccountSelectEntryPoint : FeatureEntryPoint {
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onSelectAccount(sessionId: SessionId)
|
||||
fun onAccountSelected(sessionId: SessionId)
|
||||
fun onCancel()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ class AccountSelectNode(
|
||||
callbacks.forEach { it.onCancel() }
|
||||
}
|
||||
|
||||
private fun onSelectAccount(sessionId: SessionId) {
|
||||
callbacks.forEach { it.onSelectAccount(sessionId) }
|
||||
private fun onAccountSelected(sessionId: SessionId) {
|
||||
callbacks.forEach { it.onAccountSelected(sessionId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -42,7 +42,7 @@ class AccountSelectNode(
|
||||
AccountSelectView(
|
||||
state = state,
|
||||
onDismiss = ::onDismiss,
|
||||
onSelectAccount = ::onSelectAccount,
|
||||
onSelectAccount = ::onAccountSelected,
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class DefaultAccountSelectEntryPointTest {
|
||||
)
|
||||
}
|
||||
val callback = object : AccountSelectEntryPoint.Callback {
|
||||
override fun onSelectAccount(sessionId: SessionId) = lambdaError()
|
||||
override fun onAccountSelected(sessionId: SessionId) = lambdaError()
|
||||
override fun onCancel() = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
|
||||
@@ -23,7 +23,7 @@ interface MediaGalleryEntryPoint : FeatureEntryPoint {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onBackClick()
|
||||
fun onViewInTimeline(eventId: EventId)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
fun viewInTimeline(eventId: EventId)
|
||||
fun forward(eventId: EventId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ interface MediaViewerEntryPoint : FeatureEntryPoint {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onDone()
|
||||
fun onViewInTimeline(eventId: EventId)
|
||||
fun onForwardEvent(eventId: EventId)
|
||||
fun viewInTimeline(eventId: EventId)
|
||||
fun forwardEvent(eventId: EventId)
|
||||
}
|
||||
|
||||
data class Params(
|
||||
|
||||
@@ -38,9 +38,9 @@ class MediaGalleryNode(
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onBackClick()
|
||||
fun onItemClick(item: MediaItem.Event)
|
||||
fun onViewInTimeline(eventId: EventId)
|
||||
fun onForward(eventId: EventId)
|
||||
fun showItem(item: MediaItem.Event)
|
||||
fun viewInTimeline(eventId: EventId)
|
||||
fun forward(eventId: EventId)
|
||||
}
|
||||
|
||||
private fun onBackClick() {
|
||||
@@ -51,19 +51,19 @@ class MediaGalleryNode(
|
||||
|
||||
override fun onViewInTimelineClick(eventId: EventId) {
|
||||
plugins<Callback>().forEach {
|
||||
it.onViewInTimeline(eventId)
|
||||
it.viewInTimeline(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onForwardClick(eventId: EventId) {
|
||||
plugins<Callback>().forEach {
|
||||
it.onForward(eventId)
|
||||
it.forward(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
private fun onItemClick(item: MediaItem.Event) {
|
||||
plugins<Callback>().forEach {
|
||||
it.onItemClick(item)
|
||||
it.showItem(item)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,13 +78,13 @@ class MediaGalleryFlowNode(
|
||||
|
||||
private fun onViewInTimeline(eventId: EventId) {
|
||||
plugins<MediaGalleryEntryPoint.Callback>().forEach {
|
||||
it.onViewInTimeline(eventId)
|
||||
it.viewInTimeline(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
private fun forwardEvent(eventId: EventId) {
|
||||
plugins<MediaGalleryEntryPoint.Callback>().forEach {
|
||||
it.forwardEvent(eventId)
|
||||
it.forward(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,15 +96,15 @@ class MediaGalleryFlowNode(
|
||||
this@MediaGalleryFlowNode.onBackClick()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
this@MediaGalleryFlowNode.onViewInTimeline(eventId)
|
||||
}
|
||||
|
||||
override fun onForward(eventId: EventId) {
|
||||
override fun forward(eventId: EventId) {
|
||||
forwardEvent(eventId)
|
||||
}
|
||||
|
||||
override fun onItemClick(item: MediaItem.Event) {
|
||||
override fun showItem(item: MediaItem.Event) {
|
||||
val mode = when (item) {
|
||||
is MediaItem.Audio,
|
||||
is MediaItem.Voice,
|
||||
@@ -131,13 +131,13 @@ class MediaGalleryFlowNode(
|
||||
overlay.hide()
|
||||
}
|
||||
|
||||
override fun onViewInTimeline(eventId: EventId) {
|
||||
override fun viewInTimeline(eventId: EventId) {
|
||||
this@MediaGalleryFlowNode.onViewInTimeline(eventId)
|
||||
}
|
||||
|
||||
override fun onForwardEvent(eventId: EventId) {
|
||||
override fun forwardEvent(eventId: EventId) {
|
||||
// Need to go to the parent because of the overlay
|
||||
forwardEvent(eventId)
|
||||
this@MediaGalleryFlowNode.forwardEvent(eventId)
|
||||
}
|
||||
}
|
||||
mediaViewerEntryPoint.nodeBuilder(this, buildContext)
|
||||
|
||||
@@ -67,13 +67,13 @@ class MediaViewerNode(
|
||||
|
||||
override fun onViewInTimelineClick(eventId: EventId) {
|
||||
plugins<MediaViewerEntryPoint.Callback>().forEach {
|
||||
it.onViewInTimeline(eventId)
|
||||
it.viewInTimeline(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onForwardClick(eventId: EventId) {
|
||||
plugins<MediaViewerEntryPoint.Callback>().forEach {
|
||||
it.onForwardEvent(eventId)
|
||||
it.forwardEvent(eventId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ class DefaultMediaGalleryEntryPointTest {
|
||||
}
|
||||
val callback = object : MediaGalleryEntryPoint.Callback {
|
||||
override fun onBackClick() = lambdaError()
|
||||
override fun onViewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun forwardEvent(eventId: EventId) = lambdaError()
|
||||
override fun viewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun forward(eventId: EventId) = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.callback(callback)
|
||||
|
||||
@@ -71,8 +71,8 @@ class DefaultMediaViewerEntryPointTest {
|
||||
}
|
||||
val callback = object : MediaViewerEntryPoint.Callback {
|
||||
override fun onDone() = lambdaError()
|
||||
override fun onViewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun onForwardEvent(eventId: EventId) = lambdaError()
|
||||
override fun viewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun forwardEvent(eventId: EventId) = lambdaError()
|
||||
}
|
||||
val params = createMediaViewerEntryPointParams()
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
@@ -115,8 +115,8 @@ class DefaultMediaViewerEntryPointTest {
|
||||
}
|
||||
val callback = object : MediaViewerEntryPoint.Callback {
|
||||
override fun onDone() = lambdaError()
|
||||
override fun onViewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun onForwardEvent(eventId: EventId) = lambdaError()
|
||||
override fun viewInTimeline(eventId: EventId) = lambdaError()
|
||||
override fun forwardEvent(eventId: EventId) = lambdaError()
|
||||
}
|
||||
val result = entryPoint.nodeBuilder(parentNode, BuildContext.root(null))
|
||||
.avatar(
|
||||
|
||||
@@ -42,7 +42,7 @@ class RoomSelectNode(
|
||||
callbacks.forEach { it.onCancel() }
|
||||
}
|
||||
|
||||
private fun onSubmit(roomIds: List<RoomId>) {
|
||||
private fun onRoomSelected(roomIds: List<RoomId>) {
|
||||
callbacks.forEach { it.onRoomSelected(roomIds) }
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class RoomSelectNode(
|
||||
RoomSelectView(
|
||||
state = state,
|
||||
onDismiss = ::onDismiss,
|
||||
onSubmit = ::onSubmit,
|
||||
onSubmit = ::onRoomSelected,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ interface NotificationTroubleShootEntryPoint : FeatureEntryPoint {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onDone()
|
||||
fun openIgnoredUsers()
|
||||
fun navigateToBlockedUsers()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ interface PushHistoryEntryPoint : FeatureEntryPoint {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onDone()
|
||||
fun navigateTo(roomId: RoomId, eventId: EventId)
|
||||
fun navigateToEvent(roomId: RoomId, eventId: EventId)
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user