|
|
|
@ -4,7 +4,6 @@ |
|
|
|
|
|
|
|
|
|
import "./ui" |
|
|
|
|
import "./dialogs" |
|
|
|
|
import Qt.labs.platform 1.1 as Platform |
|
|
|
|
import QtQuick 2.15 |
|
|
|
|
import QtQuick.Controls 2.15 |
|
|
|
|
import QtQuick.Layouts 1.2 |
|
|
|
@ -393,7 +392,7 @@ Item { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.Menu { |
|
|
|
|
Menu { |
|
|
|
|
id: messageContextMenuC |
|
|
|
|
|
|
|
|
|
property string eventId |
|
|
|
@ -448,7 +447,7 @@ Item { |
|
|
|
|
ReportMessage {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("Go to &message") |
|
|
|
|
visible: filteredTimeline.filterByContent |
|
|
|
@ -458,21 +457,21 @@ Item { |
|
|
|
|
room.showEvent(messageContextMenuC.eventId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Copy") |
|
|
|
|
visible: messageContextMenuC.text |
|
|
|
|
|
|
|
|
|
onTriggered: Clipboard.text = messageContextMenuC.text |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("Copy &link location") |
|
|
|
|
visible: messageContextMenuC.link |
|
|
|
|
|
|
|
|
|
onTriggered: Clipboard.text = messageContextMenuC.link |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
id: reactionOption |
|
|
|
|
|
|
|
|
|
text: qsTr("Re&act") |
|
|
|
@ -483,39 +482,39 @@ Item { |
|
|
|
|
TimelineManager.focusMessageInput(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("Repl&y") |
|
|
|
|
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false |
|
|
|
|
|
|
|
|
|
onTriggered: room.reply = (messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Edit") |
|
|
|
|
visible: messageContextMenuC.isEditable && (room ? room.permissions.canSend(MtxEvent.TextMessage) : false) |
|
|
|
|
|
|
|
|
|
onTriggered: room.edit = (messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Thread") |
|
|
|
|
visible: (room ? room.permissions.canSend(MtxEvent.TextMessage) : false) |
|
|
|
|
|
|
|
|
|
onTriggered: room.thread = (messageContextMenuC.threadId || messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: visible && room.pinnedMessages.includes(messageContextMenuC.eventId) ? qsTr("Un&pin") : qsTr("&Pin") |
|
|
|
|
visible: (room ? room.permissions.canChange(MtxEvent.PinnedEvents) : false) |
|
|
|
|
|
|
|
|
|
onTriggered: visible && room.pinnedMessages.includes(messageContextMenuC.eventId) ? room.unpin(messageContextMenuC.eventId) : room.pin(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("&Read receipts") |
|
|
|
|
|
|
|
|
|
onTriggered: room.showReadReceipts(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("&Forward") |
|
|
|
|
visible: messageContextMenuC.eventType == MtxEvent.ImageMessage || messageContextMenuC.eventType == MtxEvent.VideoMessage || messageContextMenuC.eventType == MtxEvent.AudioMessage || messageContextMenuC.eventType == MtxEvent.FileMessage || messageContextMenuC.eventType == MtxEvent.Sticker || messageContextMenuC.eventType == MtxEvent.TextMessage || messageContextMenuC.eventType == MtxEvent.LocationMessage || messageContextMenuC.eventType == MtxEvent.EmoteMessage || messageContextMenuC.eventType == MtxEvent.NoticeMessage |
|
|
|
|
|
|
|
|
@ -526,15 +525,15 @@ Item { |
|
|
|
|
timelineRoot.destroyOnClose(forwardMess); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("&Mark as read") |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("View raw message") |
|
|
|
|
|
|
|
|
|
onTriggered: room.viewRawMessage(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("View decrypted raw message") |
|
|
|
|
// TODO(Nico): Fix this still being iterated over, when using keyboard to select options |
|
|
|
@ -542,7 +541,7 @@ Item { |
|
|
|
|
|
|
|
|
|
onTriggered: room.viewDecryptedRawMessage(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("Remo&ve message") |
|
|
|
|
visible: (room ? room.permissions.canRedact() : false) || messageContextMenuC.isSender |
|
|
|
|
|
|
|
|
@ -554,7 +553,7 @@ Item { |
|
|
|
|
timelineRoot.destroyOnClose(dialog); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
text: qsTr("Report message") |
|
|
|
|
enabled: visible |
|
|
|
|
onTriggered: function () { |
|
|
|
@ -564,21 +563,21 @@ Item { |
|
|
|
|
timelineRoot.destroyOnClose(dialog); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Save as") |
|
|
|
|
visible: messageContextMenuC.eventType == MtxEvent.ImageMessage || messageContextMenuC.eventType == MtxEvent.VideoMessage || messageContextMenuC.eventType == MtxEvent.AudioMessage || messageContextMenuC.eventType == MtxEvent.FileMessage || messageContextMenuC.eventType == MtxEvent.Sticker |
|
|
|
|
|
|
|
|
|
onTriggered: room.saveMedia(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Open in external program") |
|
|
|
|
visible: messageContextMenuC.eventType == MtxEvent.ImageMessage || messageContextMenuC.eventType == MtxEvent.VideoMessage || messageContextMenuC.eventType == MtxEvent.AudioMessage || messageContextMenuC.eventType == MtxEvent.FileMessage || messageContextMenuC.eventType == MtxEvent.Sticker |
|
|
|
|
|
|
|
|
|
onTriggered: room.openMedia(messageContextMenuC.eventId) |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("Copy link to eve&nt") |
|
|
|
|
visible: messageContextMenuC.eventId |
|
|
|
@ -592,7 +591,7 @@ Item { |
|
|
|
|
ForwardCompleter { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Platform.Menu { |
|
|
|
|
Menu { |
|
|
|
|
id: replyContextMenuC |
|
|
|
|
|
|
|
|
|
property string eventId |
|
|
|
@ -606,21 +605,21 @@ Item { |
|
|
|
|
open(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Copy") |
|
|
|
|
visible: replyContextMenuC.text |
|
|
|
|
|
|
|
|
|
onTriggered: Clipboard.text = replyContextMenuC.text |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("Copy &link location") |
|
|
|
|
visible: replyContextMenuC.link |
|
|
|
|
|
|
|
|
|
onTriggered: Clipboard.text = replyContextMenuC.link |
|
|
|
|
} |
|
|
|
|
Platform.MenuItem { |
|
|
|
|
MenuItem { |
|
|
|
|
enabled: visible |
|
|
|
|
text: qsTr("&Go to quoted message") |
|
|
|
|
visible: true |
|
|
|
|