Room default power level awareness

This commit is contained in:
miruka 2020-07-12 19:28:40 -04:00
parent 9d397b62c5
commit 0459657575
4 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# TODO # TODO
- warn about setting level of someone to 100
- gray out if no permission to change
- improve event text
- save and restore status in accounts.json - save and restore status in accounts.json
- mark accounts as offline when closing mirage - mark accounts as offline when closing mirage
- document new x11 dependnecy (auto-idle) - document new x11 dependnecy (auto-idle)

View File

@ -1683,6 +1683,7 @@ class MatrixClient(nio.AsyncClient):
invite_required = room.join_rule == "invite", invite_required = room.join_rule == "invite",
guests_allowed = room.guest_access == "can_join", guests_allowed = room.guest_access == "can_join",
default_power_level = levels.defaults.users_default,
can_invite = levels.can_user_invite(self.user), can_invite = levels.can_user_invite(self.user),
can_kick = levels.can_user_kick(self.user), can_kick = levels.can_user_kick(self.user),
can_redact_all = levels.can_user_redact(self.user), can_redact_all = levels.can_user_redact(self.user),

View File

@ -179,6 +179,7 @@ class Room(ModelItem):
invite_required: bool = True invite_required: bool = True
guests_allowed: bool = True guests_allowed: bool = True
default_power_level: int = 0
can_invite: bool = False can_invite: bool = False
can_kick: bool = False can_kick: bool = False
can_redact_all: bool = False can_redact_all: bool = False

View File

@ -51,8 +51,8 @@ AutoDirectionLayout {
HButton { HButton {
height: parent.height height: parent.height
icon.name: "user-power-default" icon.name: "user-power-default"
toolTip.text: qsTr("Default") toolTip.text: qsTr("Limited")
checked: control.level >= 0 && control.level < 50 checked: control.level < 50
uncheckable: false uncheckable: false
onClicked: field.text = 0 onClicked: field.text = 0
} }