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