create room : use user homeserver in the address field.
This commit is contained in:
@@ -55,6 +55,7 @@ class ConfigureRoomPresenter @Inject constructor(
|
||||
override fun present(): ConfigureRoomState {
|
||||
val cameraPermissionState = cameraPermissionPresenter.present()
|
||||
val createRoomConfig = dataStore.createRoomConfig.collectAsState(CreateRoomConfig())
|
||||
val homeserverName = remember { matrixClient.userIdServerName() }
|
||||
|
||||
val cameraPhotoPicker = mediaPickerProvider.registerCameraPhotoPicker(
|
||||
onResult = { uri -> if (uri != null) dataStore.setAvatarUri(uri = uri, cached = true) },
|
||||
@@ -120,6 +121,7 @@ class ConfigureRoomPresenter @Inject constructor(
|
||||
avatarActions = avatarActions,
|
||||
createRoomAction = createRoomAction.value,
|
||||
cameraPermissionState = cameraPermissionState,
|
||||
homeserverName = homeserverName,
|
||||
eventSink = ::handleEvents,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ data class ConfigureRoomState(
|
||||
val avatarActions: ImmutableList<AvatarAction>,
|
||||
val createRoomAction: AsyncAction<RoomId>,
|
||||
val cameraPermissionState: PermissionsState,
|
||||
val homeserverName: String,
|
||||
val eventSink: (ConfigureRoomEvents) -> Unit
|
||||
) {
|
||||
val isCreateButtonEnabled: Boolean = config.roomName.isNullOrEmpty().not()
|
||||
|
||||
@@ -38,5 +38,6 @@ fun aConfigureRoomState() = ConfigureRoomState(
|
||||
avatarActions = persistentListOf(),
|
||||
createRoomAction = AsyncAction.Uninitialized,
|
||||
cameraPermissionState = aPermissionsState(showDialog = false),
|
||||
homeserverName = "matrix.org",
|
||||
eventSink = { },
|
||||
)
|
||||
|
||||
@@ -141,6 +141,7 @@ fun ConfigureRoomView(
|
||||
RoomAddress(
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
address = state.config.roomVisibility.roomAddress,
|
||||
homeserverName = state.homeserverName,
|
||||
onAddressChange = { state.eventSink(ConfigureRoomEvents.RoomAddressChanged(it)) },
|
||||
)
|
||||
}
|
||||
@@ -311,6 +312,7 @@ private fun RoomAccessOptions(
|
||||
@Composable
|
||||
private fun RoomAddress(
|
||||
address: RoomAddress,
|
||||
homeserverName: String,
|
||||
onAddressChange: (String) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
@@ -340,7 +342,7 @@ private fun RoomAddress(
|
||||
},
|
||||
trailingIcon = {
|
||||
Text(
|
||||
text = ":myserver.com",
|
||||
text = homeserverName,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
modifier = Modifier.padding(end = 16.dp)
|
||||
|
||||
Reference in New Issue
Block a user