From 75ef6e70a48fd3e47cd8321433151e3c0142eb8e Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Tue, 29 Sep 2020 15:50:21 +0200 Subject: [PATCH] update live locations --- qml/components/LocationPreview.qml | 1 + qml/pages/ChatPage.qml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/qml/components/LocationPreview.qml b/qml/components/LocationPreview.qml index f2882a5..bb83ab5 100644 --- a/qml/components/LocationPreview.qml +++ b/qml/components/LocationPreview.qml @@ -32,6 +32,7 @@ Item { } function updatePicture() { + imagePreviewItem.pictureFileInformation = null; if (locationData) { tdLibWrapper.getMapThumbnailFile(chatId, locationData.latitude, locationData.longitude, Math.round(imagePreviewItem.width), Math.round(imagePreviewItem.height)); } diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 4e40703..aadc9c6 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -757,6 +757,10 @@ Page { console.log("[ChatModel] This message was updated, index " + index + ", updating content..."); messageDateText.text = getMessageStatusText(display, index, chatView.lastReadSentIndex); messageText.text = Emoji.emojify(Functions.getMessageText(display, false), messageText.font.pixelSize); + if(locationPreviewLoader.active && locationPreviewLoader.status === Loader.Ready) { + locationPreviewLoader.item.locationData = display.content.location; + locationPreviewLoader.item.updatePicture() + } } } }