Rename fun in Callback for clarity.

This commit is contained in:
Benoit Marty 2025-10-29 10:30:30 +01:00 committed by Benoit Marty
parent 353c00e032
commit 43972dba68
104 changed files with 658 additions and 664 deletions

View file

@ -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
}
}

View file

@ -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,
)
}
}

View file

@ -67,7 +67,7 @@ class DefaultUserProfileEntryPointTest {
)
}
val callback = object : UserProfileEntryPoint.Callback {
override fun onOpenRoom(roomId: RoomId) {
override fun navigateToRoom(roomId: RoomId) {
lambdaError()
}
}