Add RedactionEvent support on backend
This commit is contained in:
@@ -33,6 +33,7 @@ HColumnLayout {
|
||||
readonly property bool smallAvatar: compact
|
||||
readonly property bool collapseAvatar: combine
|
||||
readonly property bool hideAvatar: onRight
|
||||
readonly property bool isRedacted: model.event_type === "RedactionEvent"
|
||||
|
||||
readonly property bool hideNameLine:
|
||||
model.event_type === "RoomMessageEmote" ||
|
||||
@@ -221,6 +222,7 @@ HColumnLayout {
|
||||
HMenuItemPopupSpawner {
|
||||
icon.name: "remove-message"
|
||||
text: qsTr("Remove")
|
||||
enabled: ! isRedacted
|
||||
|
||||
popup: "Popups/RedactEvents.qml"
|
||||
popupParent: chat
|
||||
|
@@ -200,6 +200,14 @@ QtObject {
|
||||
return qsTr(ev.content).arg(sender).arg(target)
|
||||
}
|
||||
|
||||
if (type === "RedactionEvent") {
|
||||
return qsTr(
|
||||
"<i>Removed message" +
|
||||
`${ev.reason ? ". Reason: " + ev.reason : ""}` +
|
||||
"</i>"
|
||||
)
|
||||
}
|
||||
|
||||
return qsTr(ev.content).arg(sender)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user