From 3c1d92618805ab05e9affe366b32d457e99df79a Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 4 Nov 2019 14:56:53 -0400 Subject: [PATCH] Open decrypted file in browser for crypt images --- src/qml/Chat/Timeline/EventImage.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index 75fad174..e9492a7c 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -20,18 +20,20 @@ HMxcImage { property EventMediaLoader loader + readonly property bool isEncrypted: ! Utils.isEmptyObject(cryptDict) + readonly property string openUrl: isEncrypted ? cachedPath : image.httpUrl TapHandler { - onTapped: if (! image.animated) Qt.openUrlExternally(image.httpUrl) - onDoubleTapped: Qt.openUrlExternally(image.httpUrl) + onTapped: if (! image.animated) Qt.openUrlExternally(openUrl) + onDoubleTapped: Qt.openUrlExternally(openUrl) } HoverHandler { id: hover onHoveredChanged: eventDelegate.hoveredMediaTypeUrl = - hovered ? [EventDelegate.Media.Image, image.httpUrl] : [] + hovered ? [EventDelegate.Media.Image, openUrl] : [] } EventImageTextBubble {