Add support for venues

This commit is contained in:
Sebastian J. Wolf 2020-09-29 21:58:14 +02:00
parent d92ea9fbae
commit f19b3ae4cb
9 changed files with 33 additions and 5 deletions

View file

@ -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)

View file

@ -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") : ( "<b>" + message.content.venue.title + "</b>, " + message.content.venue.address );
}
if (message.content['@type'] === 'messageContactRegistered') {
return qsTr("has registered with Telegram");

View file

@ -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" )
}
}

View file

@ -496,7 +496,7 @@
</message>
<message>
<source>sent a location</source>
<translation>hat einen Ort geschickt</translation>
<translation>hat einen Standort geschickt</translation>
</message>
<message>
<source>joined this chat</source>
@ -518,5 +518,9 @@
<source>%1K</source>
<translation>%1T</translation>
</message>
<message>
<source>sent a venue</source>
<translation>hat einen Ort geschickt</translation>
</message>
</context>
</TS>

View file

@ -518,5 +518,9 @@
<source>%1K</source>
<translation>%1K</translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -518,5 +518,9 @@
<source>%1K</source>
<translation>%1K</translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -518,5 +518,9 @@
<source>%1K</source>
<translation>%1K</translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -518,5 +518,9 @@
<source>%1K</source>
<translation>%1T</translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -518,5 +518,9 @@
<source>%1K</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>