Code review

This commit is contained in:
Valere 2021-09-15 09:30:40 +02:00
parent 2c1435f08c
commit 70ebb3a3f2
6 changed files with 12 additions and 11 deletions

View file

@ -78,7 +78,7 @@ internal class DefaultSpaceService @Inject constructor(
if (isPublic) {
this.roomAliasName = roomAliasLocalPart
this.powerLevelContentOverride = (powerLevelContentOverride ?: PowerLevelsContent()).copy(
invite = if (isPublic) 0 else Role.Moderator.value
invite = if (isPublic) Role.Default.value else Role.Moderator.value
)
this.preset = CreateRoomPreset.PRESET_PUBLIC_CHAT
this.historyVisibility = RoomHistoryVisibility.WORLD_READABLE

View file

@ -77,6 +77,7 @@ sealed class EditablePermission(@StringRes val labelResId: Int, @StringRes val s
class UpgradeTheRoom : EventTypeEditablePermission(
EventType.STATE_ROOM_TOMBSTONE,
R.string.room_permissions_upgrade_the_room,
R.string.room_permissions_upgrade_the_space
)

View file

@ -75,7 +75,7 @@ class CreateSpaceViewModelTask @Inject constructor(
if (params.isPublic) {
this.roomAliasName = params.spaceAlias
this.powerLevelContentOverride = (powerLevelContentOverride ?: PowerLevelsContent()).copy(
invite = 0
invite = Role.Default.value
)
this.preset = CreateRoomPreset.PRESET_PUBLIC_CHAT
this.historyVisibility = RoomHistoryVisibility.WORLD_READABLE

View file

@ -48,16 +48,16 @@ class SpaceManageSharedViewModel @AssistedInject constructor(
override fun handle(action: SpaceManagedSharedAction) {
when (action) {
SpaceManagedSharedAction.HandleBack -> {
SpaceManagedSharedAction.HandleBack -> {
// for now finish
_viewEvents.post(SpaceManagedSharedViewEvents.Finish)
}
SpaceManagedSharedAction.HideLoading -> _viewEvents.post(SpaceManagedSharedViewEvents.HideLoading)
SpaceManagedSharedAction.ShowLoading -> _viewEvents.post(SpaceManagedSharedViewEvents.ShowLoading)
SpaceManagedSharedAction.CreateRoom -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToCreateRoom)
SpaceManagedSharedAction.ManageRooms -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToManageRooms)
SpaceManagedSharedAction.OpenSpaceAliasesSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToAliasSettings)
SpaceManagedSharedAction.OpenRoomPermissionSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToPermissionSettings)
SpaceManagedSharedAction.HideLoading -> _viewEvents.post(SpaceManagedSharedViewEvents.HideLoading)
SpaceManagedSharedAction.ShowLoading -> _viewEvents.post(SpaceManagedSharedViewEvents.ShowLoading)
SpaceManagedSharedAction.CreateRoom -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToCreateRoom)
SpaceManagedSharedAction.ManageRooms -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToManageRooms)
SpaceManagedSharedAction.OpenSpaceAliasesSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToAliasSettings)
SpaceManagedSharedAction.OpenSpacePermissionSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToPermissionSettings)
}
}
}

View file

@ -25,5 +25,5 @@ sealed class SpaceManagedSharedAction : VectorViewModelAction {
object CreateRoom : SpaceManagedSharedAction()
object ManageRooms : SpaceManagedSharedAction()
object OpenSpaceAliasesSettings : SpaceManagedSharedAction()
object OpenRoomPermissionSettings : SpaceManagedSharedAction()
object OpenSpacePermissionSettings : SpaceManagedSharedAction()
}

View file

@ -238,7 +238,7 @@ class SpaceSettingsFragment @Inject constructor(
}
override fun onRoomPermissionsClicked() {
sharedViewModel.handle(SpaceManagedSharedAction.OpenRoomPermissionSettings)
sharedViewModel.handle(SpaceManagedSharedAction.OpenSpacePermissionSettings)
}
override fun onImageReady(uri: Uri?) {