diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index 59e01599..29c658f7 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -117,7 +117,7 @@ ScrollView {
image: ":/icons/icons/ui/vertical-ellipsis.png"
ToolTip.visible: hovered
ToolTip.text: qsTr("Options")
- onClicked: messageContextMenu.show(row.model.id, row.model.type, row.model.isEncrypted, row.model.isEditable, optionsButton)
+ onClicked: messageContextMenu.show(row.model.id, row.model.type, row.model.isEncrypted, row.model.isEditable, "", optionsButton)
}
}
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 321be5b2..e9c8b297 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -28,12 +28,12 @@ Item {
TapHandler {
acceptedButtons: Qt.RightButton
- onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable)
+ onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, contentItem.child.hoveredLink)
gesturePolicy: TapHandler.ReleaseWithinBounds
}
TapHandler {
- onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable)
+ onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, contentItem.child.hoveredLink)
onDoubleTapped: chat.model.reply = model.id
gesturePolicy: TapHandler.ReleaseWithinBounds
}
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 59a98bdb..ce5d54c0 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -92,15 +92,20 @@ Page {
id: messageContextMenu
property string eventId
+ property string link
property int eventType
property bool isEncrypted
property bool isEditable
- function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_) {
+ function show(eventId_, eventType_, isEncrypted_, isEditable_, link_, showAt_) {
eventId = eventId_;
eventType = eventType_;
isEncrypted = isEncrypted_;
isEditable = isEditable_;
+ if (link_)
+ link = link_;
+ else
+ link = "";
if (showAt_)
open(showAt_);
else
@@ -108,6 +113,13 @@ Page {
}
Platform.MenuItem {
+ visible: messageContextMenu.link
+ enabled: visible
+ text: qsTr("Copy address location")
+ onTriggered: Clipboard.text = messageContextMenu.link
+ }
+
+ Platform.MenuItem {
id: reactionOption
text: qsTr("React")
@@ -177,7 +189,7 @@ Page {
enabled: visible
text: qsTr("Open in external program")
onTriggered: TimelineManager.timeline.openMedia(messageContextMenu.eventId)
- }
+ }
Platform.MenuItem {
visible: messageContextMenu.eventId
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 211e03a6..d278a586 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -8,6 +8,7 @@ import im.nheko 1.0
Item {
property alias modelData: model.data
property alias isReply: model.isReply
+ property alias child: chooser.child
property real implicitWidth: (chooser.child && chooser.child.implicitWidth) ? chooser.child.implicitWidth : width
height: chooser.childrenRect.height
|