From f19b3ae4cbd467e589b8b978cd624d1eecee47f1 Mon Sep 17 00:00:00 2001 From: "Sebastian J. Wolf" Date: Tue, 29 Sep 2020 21:58:14 +0200 Subject: [PATCH] Add support for venues --- README.md | 1 + qml/js/functions.js | 5 ++++- qml/pages/ChatPage.qml | 6 +++--- translations/harbour-fernschreiber-de.ts | 6 +++++- translations/harbour-fernschreiber-es.ts | 4 ++++ translations/harbour-fernschreiber-hu.ts | 4 ++++ translations/harbour-fernschreiber-pl.ts | 4 ++++ translations/harbour-fernschreiber-zh_CN.ts | 4 ++++ translations/harbour-fernschreiber.ts | 4 ++++ 9 files changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e36724e..1752f98 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Fernschreiber wouldn't be the same without all the people helping in making it b ### Code (Features, Bugfixes, Optimizations etc.) - Chat list model, TDLib receiver, project dependencies: [Slava Monich](https://github.com/monich) +- Location support, project dependencies: [jgibbon](https://github.com/jgibbon) ### Translations - Chinese: [dashinfantry](https://github.com/dashinfantry) diff --git a/qml/js/functions.js b/qml/js/functions.js index 0534128..a1e07f4 100644 --- a/qml/js/functions.js +++ b/qml/js/functions.js @@ -77,7 +77,10 @@ function getMessageText(message, simple) { } } if (message.content['@type'] === 'messageLocation') { - return qsTr("sent a location"); + return simple ? qsTr("sent a location") : ""; + } + if (message.content['@type'] === 'messageVenue') { + return simple ? qsTr("sent a venue") : ( "" + message.content.venue.title + ", " + message.content.venue.address ); } if (message.content['@type'] === 'messageContactRegistered') { return qsTr("has registered with Telegram"); diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 255104c..0b360a5 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -496,7 +496,7 @@ Page { videoPreviewLoader.active = (( display.content['@type'] === "messageVideo" ) || ( display.content['@type'] === "messageAnimation" )); audioPreviewLoader.active = (( display.content['@type'] === "messageVoiceNote" ) || ( display.content['@type'] === "messageAudio" )); documentPreviewLoader.active = ( display.content['@type'] === "messageDocument" ); - locationPreviewLoader.active = ( display.content['@type'] === "messageLocation" ) + locationPreviewLoader.active = ( display.content['@type'] === "messageLocation" || ( display.content['@type'] === "messageVenue" )) } } @@ -736,8 +736,8 @@ Page { width: parent.width height: parent.width * 2 / 3 chatId: display.id - locationData: ( display.content['@type'] === "messageLocation" ) ? display.content.location : "" - visible: display.content['@type'] === "messageLocation" + locationData: ( display.content['@type'] === "messageLocation" ) ? display.content.location : ( ( display.content['@type'] === "messageVenue" ) ? display.content.venue.location : "" ) + visible: ( display.content['@type'] === "messageLocation" || display.content['@type'] === "messageVenue" ) } } diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index d22a46f..d75cc4a 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -496,7 +496,7 @@ sent a location - hat einen Ort geschickt + hat einen Standort geschickt joined this chat @@ -518,5 +518,9 @@ %1K %1T + + sent a venue + hat einen Ort geschickt + diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index bfb8826..6255385 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -518,5 +518,9 @@ %1K %1K + + sent a venue + + diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index ba6bb16..fd21945 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -518,5 +518,9 @@ %1K %1K + + sent a venue + + diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 8c048d8..2cb4898 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -518,5 +518,9 @@ %1K %1K + + sent a venue + + diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index b966bb8..9ec26f7 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -518,5 +518,9 @@ %1K %1T + + sent a venue + + diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 6bffa4a..bec6038 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -518,5 +518,9 @@ %1K + + sent a venue + +