mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +03:00
Code review
This commit is contained in:
parent
2c1435f08c
commit
70ebb3a3f2
6 changed files with 12 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,5 +25,5 @@ sealed class SpaceManagedSharedAction : VectorViewModelAction {
|
|||
object CreateRoom : SpaceManagedSharedAction()
|
||||
object ManageRooms : SpaceManagedSharedAction()
|
||||
object OpenSpaceAliasesSettings : SpaceManagedSharedAction()
|
||||
object OpenRoomPermissionSettings : SpaceManagedSharedAction()
|
||||
object OpenSpacePermissionSettings : SpaceManagedSharedAction()
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ class SpaceSettingsFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onRoomPermissionsClicked() {
|
||||
sharedViewModel.handle(SpaceManagedSharedAction.OpenRoomPermissionSettings)
|
||||
sharedViewModel.handle(SpaceManagedSharedAction.OpenSpacePermissionSettings)
|
||||
}
|
||||
|
||||
override fun onImageReady(uri: Uri?) {
|
||||
|
|
Loading…
Reference in a new issue