Make sure that only text messages can be edited

This commit is contained in:
James Graham
2024-02-25 16:57:07 +00:00
parent e95f191dc6
commit 38edad2ac5
4 changed files with 13 additions and 1 deletions

View File

@@ -90,7 +90,7 @@ QQC2.Control {
onTriggered: emojiDialog.open()
},
Kirigami.Action {
visible: root.delegate && root.delegate.author.isLocalUser && (root.delegate.delegateType === DelegateType.Emote || root.delegate.delegateType === DelegateType.Message) && !root.currentRoom.readOnly
visible: root.delegate && root.delegate.isEditable && !root.currentRoom.readOnly
text: i18n("Edit")
icon.name: "document-edit"
onTriggered: {

View File

@@ -146,6 +146,11 @@ TimelineDelegate {
*/
required property bool isPending
/**
* @brief Whether the event can be edited by the local user.
*/
required property bool isEditable
/**
* @brief Whether an encrypted message is sent in a verified session.
*/