Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default power to invite in private space + setting #4001

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

BillCarsonFr
Copy link
Member

Fixes #3951

Change default power level to invite in private room to 50 (Moderator)

Also adding settings UX to change it
image

@BillCarsonFr BillCarsonFr requested a review from bmarty September 10, 2021 16:14
@BillCarsonFr BillCarsonFr added A-Spaces Spaces, groups, communities Z-NextRelease For issues and PRs which should be included in the NextRelease. labels Sep 10, 2021
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small mistake, else LGTM

@@ -77,7 +78,7 @@ internal class DefaultSpaceService @Inject constructor(
if (isPublic) {
this.roomAliasName = roomAliasLocalPart
this.powerLevelContentOverride = (powerLevelContentOverride ?: PowerLevelsContent()).copy(
invite = 0
invite = if (isPublic) 0 else Role.Moderator.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use Role.Default.value instead of 0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -70,7 +77,7 @@ sealed class EditablePermission(@StringRes val labelResId: Int) {

class UpgradeTheRoom : EventTypeEditablePermission(
EventType.STATE_ROOM_TOMBSTONE,
R.string.room_permissions_upgrade_the_room
R.string.room_permissions_upgrade_the_space
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you wanted to write:

R.string.room_permissions_upgrade_the_room,
R.string.room_permissions_upgrade_the_space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, good catch

if (params.isPublic) {
this.roomAliasName = params.spaceAlias
this.powerLevelContentOverride = (powerLevelContentOverride ?: PowerLevelsContent()).copy(
invite = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Role.Default.value

this.guestAccess = GuestAccess.CanJoin
} else {
this.preset = CreateRoomPreset.PRESET_PRIVATE_CHAT
visibility = RoomDirectoryVisibility.PRIVATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this one does not have this.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -25,4 +25,5 @@ sealed class SpaceManagedSharedAction : VectorViewModelAction {
object CreateRoom : SpaceManagedSharedAction()
object ManageRooms : SpaceManagedSharedAction()
object OpenSpaceAliasesSettings : SpaceManagedSharedAction()
object OpenRoomPermissionSettings : SpaceManagedSharedAction()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you have hesitated with OpenSpacePermissionSettings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/spaces_fix_invite_private branch from 69cfb42 to 70ebb3a Compare September 15, 2021 16:49
@github-actions
Copy link

github-actions bot commented Sep 15, 2021

Unit Test Results

  34 files  ±0    34 suites  ±0   22s ⏱️ ±0s
  73 tests ±0    73 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
180 runs  ±0  180 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit bb459a6. ± Comparison against base commit bb459a6.

♻️ This comment has been updated with latest results.

@BillCarsonFr BillCarsonFr merged commit bb459a6 into develop Sep 15, 2021
@BillCarsonFr BillCarsonFr deleted the feature/bca/spaces_fix_invite_private branch September 15, 2021 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spaces Spaces, groups, communities Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Non-Admin" user able to invite others to Private Space (by default)
2 participants