Take into account creators when checking power levels #44
No reviewers
Labels
No labels
Blocked
Good First Issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Nexus/nexus!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "istalri/nexus:creator-power-level-infinite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #40
@Henry-Hiles I hope this works could not really test to full extent since I am not a user with a big power level. I created my own room to test if I get power level null(infinite) and it worked.
@ -38,3 +43,3 @@content.users[userId] ?? content.usersDefault;final userLevel = powerLevelOf(user);//Creators get power level infinite, here marked with nullAlso when you leave comments please put a space between
//and the first word :)@ -40,1 +45,3 @@final userLevel = powerLevelOf(user);//Creators get power level infinite, here marked with nullfinal userLevel = roomCreators?.contains(user) == true? nullBetter to set this to
double.infinity. Then you shouldn't need to touch the logic below.@ -0,0 +22,4 @@return switch (createEventContent?.additionalCreatorIds) {IList<String> creators => creators.add(createEvent.sender),_ => [createEvent.sender].toIList(),A little cleaner:
@ -97,3 +97,3 @@);}}}Not sure what this change is about...
Yeah no idea what that is. This looks like a bug in the diff tool to me. Or maybe some white space is different?
WIP: Creator power level gets taken into accountto Creator power level gets taken into account@ -0,0 +13,4 @@final createRowId = room.state[EventType.create.type]?[""];final createEvent = createRowId == null ? null : room.events[createRowId];if (createEvent == null) return null;I think it's best to make this function/controller/provider return
IList<String>, and return a.new()instead of null.Creator power level gets taken into accountto Take into account creators when checking power levelsLGTM
Thanks for the contribution :)