From 6c4e5466c019319edfa96461d376bbf3b7bf8d5c Mon Sep 17 00:00:00 2001 From: molan-git Date: Tue, 9 Jun 2020 18:46:36 +0200 Subject: [PATCH] fix copy toot-URL if the toot url isn't provided (for example in retoots), the toot uri will be used --- qml/pages/ConversationPage.qml | 30 +++++++++++++++++------- qml/pages/components/VisualContainer.qml | 1 + 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/qml/pages/ConversationPage.qml b/qml/pages/ConversationPage.qml index fb57082..841d49d 100644 --- a/qml/pages/ConversationPage.qml +++ b/qml/pages/ConversationPage.qml @@ -17,8 +17,9 @@ Page { property ListModel suggestedModel property string toot_id: "" property string toot_url: "" + property string toot_uri: "" property int tootMaxChar: 500; - property ListModel mdl + property ListModel mdl allowedOrientations: Orientation.All onSuggestedUserChanged: { @@ -100,13 +101,26 @@ Page { } PullDownMenu { - visible: type === "reply" && toot_url !== "" - MenuItem { - text: qsTr("Copy Link to Clipboard") - onClicked: Clipboard.text = toot_url - } - } - } + id: pulleyConversation + visible: type === "reply" //&& toot_url !== "" + MenuItem { + text: qsTr("Copy Link to Clipboard") + onClicked: if (toot_url === "") { + + var test = toot_uri.split("/") + console.log(toot_uri) + console.log(JSON.stringify(test)) + console.log(JSON.stringify(test.length)) + if (test.length === 8 && (test[7] === "activity")) { + var urialt = toot_uri.replace("activity", "") + Clipboard.text = urialt + } + else Clipboard.text = toot_uri + + } else onClicked: Clipboard.text = toot_url + } + } + } Rectangle { id: predictionList diff --git a/qml/pages/components/VisualContainer.qml b/qml/pages/components/VisualContainer.qml index b86e715..279635d 100644 --- a/qml/pages/components/VisualContainer.qml +++ b/qml/pages/components/VisualContainer.qml @@ -340,6 +340,7 @@ BackgroundItem { headerTitle: "Conversation", toot_id: status_id, toot_url: status_url, + toot_uri: status_uri, title: account_display_name, description: '@'+account_acct, avatar: account_avatar,