Add history visibiltiy room setting

Add setting for setting the history visibility.

Note this setting can only be read not set for Quotient version < 0.7 as there is no event definition for a history visibility state event and it doesn't seem worth creating one when not needed with Quotient 0.7.

BUG: 457840
This commit is contained in:
James Graham
2022-11-25 16:13:01 +00:00
parent 23548ef151
commit 054ad80d30
3 changed files with 86 additions and 0 deletions

View File

@@ -58,6 +58,53 @@ Kirigami.ScrollablePage {
}
}
}
MobileForm.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18nc("@option:check", "Message history visibility")
}
MobileForm.FormRadioDelegate {
text: i18nc("@option:check", "Anyone")
description: i18nc("@option:check", "Anyone, regardless of whether they have joined, can view history.")
checked: room.historyVisibility === "world_readable"
enabled: room.canSendState("m.room.history_visibility")
onCheckedChanged: if (checked) {
room.historyVisibility = "world_readable"
}
}
MobileForm.FormRadioDelegate {
text: i18nc("@option:check", "Members only")
description: i18nc("@option:check", "All members can view the entire message history, even before they joined.")
checked: room.historyVisibility === "shared"
enabled: room.canSendState("m.room.history_visibility")
onCheckedChanged: if (checked) {
room.historyVisibility = "shared"
}
}
MobileForm.FormRadioDelegate {
text: i18nc("@option:check", "Members only (since invite)")
description: i18nc("@option:check", "New members can view the message history from the point they were invited to the room.")
checked: room.historyVisibility === "invited"
enabled: room.canSendState("m.room.history_visibility")
onCheckedChanged: if (checked) {
room.historyVisibility = "invited"
}
}
MobileForm.FormRadioDelegate {
text: i18nc("@option:check", "Members only (since joining)")
description: i18nc("@option:check", "New members can view the message history from the point they joined the room.")
checked: room.historyVisibility === "joined"
enabled: room.canSendState("m.room.history_visibility")
onCheckedChanged: if (checked) {
room.historyVisibility = "joined"
}
}
}
}
}
footer: QQC2.ToolBar {