Display information for forwarded messages
This commit is contained in:
parent
c76240e914
commit
c0269b5502
14 changed files with 114 additions and 6 deletions
|
@ -161,7 +161,7 @@ Item {
|
||||||
text: getReplacementString()
|
text: getReplacementString()
|
||||||
color: Theme.primaryColor
|
color: Theme.primaryColor
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: ( profileThumbnail.height >= Theme.itemSizeSmall ) ? Theme.fontSizeLarge : Theme.fontSizeMedium
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: "Fernschreiber 0.2"
|
text: "Fernschreiber 0.3"
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font.pixelSize: Theme.fontSizeExtraLarge
|
font.pixelSize: Theme.fontSizeExtraLarge
|
||||||
anchors {
|
anchors {
|
||||||
|
|
|
@ -502,6 +502,7 @@ Page {
|
||||||
audioPreviewLoader.active = (( display.content['@type'] === "messageVoiceNote" ) || ( display.content['@type'] === "messageAudio" ));
|
audioPreviewLoader.active = (( display.content['@type'] === "messageVoiceNote" ) || ( display.content['@type'] === "messageAudio" ));
|
||||||
documentPreviewLoader.active = ( display.content['@type'] === "messageDocument" );
|
documentPreviewLoader.active = ( display.content['@type'] === "messageDocument" );
|
||||||
locationPreviewLoader.active = ( display.content['@type'] === "messageLocation" || ( display.content['@type'] === "messageVenue" ))
|
locationPreviewLoader.active = ( display.content['@type'] === "messageLocation" || ( display.content['@type'] === "messageVenue" ))
|
||||||
|
forwardedInformationLoader.active = ( typeof display.forward_info !== "undefined" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,6 +607,82 @@ Page {
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: forwardedInformationLoader
|
||||||
|
active: false
|
||||||
|
asynchronous: true
|
||||||
|
width: parent.width
|
||||||
|
sourceComponent: Component {
|
||||||
|
Row {
|
||||||
|
id: forwardedMessageInformationRow
|
||||||
|
spacing: Theme.paddingSmall
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (display.forward_info.origin["@type"] === "messageForwardOriginChannel") {
|
||||||
|
var otherChatInformation = tdLibWrapper.getChat(display.forward_info.origin.chat_id);
|
||||||
|
forwardedThumbnail.photoData = (typeof otherChatInformation.photo !== "undefined") ? otherChatInformation.photo.small : "";
|
||||||
|
forwardedChannelText.text = otherChatInformation.title;
|
||||||
|
} else if (display.forward_info.origin["@type"] === "messageForwardOriginUser") {
|
||||||
|
var otherUserInformation = tdLibWrapper.getUserInformation(display.forward_info.origin.sender_user_id);
|
||||||
|
forwardedThumbnail.photoData = (typeof otherUserInformation.profile_photo !== "undefined") ? otherUserInformation.profile_photo.small : "";
|
||||||
|
forwardedChannelText.text = Functions.getUserName(otherUserInformation);
|
||||||
|
} else {
|
||||||
|
forwardedThumbnail.photoData = "";
|
||||||
|
forwardedChannelText.text = display.forward_info.origin.sender_user_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfileThumbnail {
|
||||||
|
id: forwardedThumbnail
|
||||||
|
replacementStringHint: forwardedChannelText.text
|
||||||
|
width: Theme.itemSizeExtraSmall
|
||||||
|
height: Theme.itemSizeExtraSmall
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
spacing: Theme.paddingSmall
|
||||||
|
width: parent.width
|
||||||
|
Text {
|
||||||
|
font.pixelSize: Theme.fontSizeExtraSmall
|
||||||
|
color: Theme.primaryColor
|
||||||
|
width: parent.width
|
||||||
|
font.italic: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
textFormat: Text.StyledText
|
||||||
|
text: qsTr("Forwarded Message")
|
||||||
|
onTruncatedChanged: {
|
||||||
|
// There is obviously a bug in QML in truncating text with images.
|
||||||
|
// We simply remove Emojis then...
|
||||||
|
if (truncated) {
|
||||||
|
text = text.replace(/\<img [^>]+\/\>/g, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
id: forwardedChannelText
|
||||||
|
font.pixelSize: Theme.fontSizeExtraSmall
|
||||||
|
color: Theme.primaryColor
|
||||||
|
width: parent.width
|
||||||
|
font.bold: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
textFormat: Text.StyledText
|
||||||
|
text: forwardedMessageInformationRow.otherChatInformation.title
|
||||||
|
onTruncatedChanged: {
|
||||||
|
// There is obviously a bug in QML in truncating text with images.
|
||||||
|
// We simply remove Emojis then...
|
||||||
|
if (truncated) {
|
||||||
|
text = text.replace(/\<img [^>]+\/\>/g, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: messageText
|
id: messageText
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ Name: harbour-fernschreiber
|
||||||
# << macros
|
# << macros
|
||||||
|
|
||||||
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
||||||
Version: 0.2
|
Version: 0.3
|
||||||
Release: 1
|
Release: 1
|
||||||
Group: Qt/Qt
|
Group: Qt/Qt
|
||||||
License: LICENSE
|
License: LICENSE
|
||||||
|
@ -27,7 +27,6 @@ BuildRequires: pkgconfig(Qt5DBus)
|
||||||
BuildRequires: pkgconfig(nemonotifications-qt5)
|
BuildRequires: pkgconfig(nemonotifications-qt5)
|
||||||
BuildRequires: pkgconfig(ngf-qt5)
|
BuildRequires: pkgconfig(ngf-qt5)
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
BuildRequires: qt5-qttools-linguist
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Fernschreiber is a Telegram client for Sailfish OS
|
Fernschreiber is a Telegram client for Sailfish OS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Name: harbour-fernschreiber
|
Name: harbour-fernschreiber
|
||||||
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
||||||
Version: 0.2
|
Version: 0.3
|
||||||
Release: 1
|
Release: 1
|
||||||
# The contents of the Group field should be one of the groups listed here:
|
# The contents of the Group field should be one of the groups listed here:
|
||||||
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
|
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
|
||||||
|
|
|
@ -803,7 +803,7 @@ void TDLibWrapper::setInitialParameters()
|
||||||
QSettings hardwareSettings("/etc/hw-release", QSettings::NativeFormat);
|
QSettings hardwareSettings("/etc/hw-release", QSettings::NativeFormat);
|
||||||
initialParameters.insert("device_model", hardwareSettings.value("NAME", "Unknown Mobile Device").toString());
|
initialParameters.insert("device_model", hardwareSettings.value("NAME", "Unknown Mobile Device").toString());
|
||||||
initialParameters.insert("system_version", QSysInfo::prettyProductName());
|
initialParameters.insert("system_version", QSysInfo::prettyProductName());
|
||||||
initialParameters.insert("application_version", "0.2");
|
initialParameters.insert("application_version", "0.3");
|
||||||
requestObject.insert("parameters", initialParameters);
|
requestObject.insert("parameters", initialParameters);
|
||||||
this->sendRequest(requestObject);
|
this->sendRequest(requestObject);
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation>Lade hoch...</translation>
|
<translation>Lade hoch...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation>Weitergeleitete Nachricht</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation>Subiendo...</translation>
|
<translation>Subiendo...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation>Lähetetään...</translation>
|
<translation>Lähetetään...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation>Отправка...</translation>
|
<translation>Отправка...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation>正在上传……</translation>
|
<translation>正在上传……</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
|
@ -173,6 +173,10 @@
|
||||||
<source>Uploading...</source>
|
<source>Uploading...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Forwarded Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
|
|
Loading…
Reference in a new issue