Merge latest upstream changes

This commit is contained in:
Sebastian Wolf 2020-12-26 16:28:03 +01:00
commit 461b724d15
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
16 changed files with 176 additions and 266 deletions

View file

@ -46,6 +46,20 @@ Moreover, you need to have a compiled version of [TDLib 1.7](https://github.com/
In case you encounter strange performance issues on startup (several seconds delay, app seems to do nothing), please be sure to [follow the instructions from the respective GitHub issue](https://github.com/tdlib/td/issues/1322), i.e. let TDLib build SQLite with `-DOMIT_MEMLOCK` and be sure to comment the two lines 22558 (`#ifndef OMIT_MEMLOCK`) and 22567 (`#endif`) in the file `sqlite/sqlite/sqlite3.c`.
Moreover, TDLib 1.7 has issues loading some pinned messages in case the message database is used (which is the case in Fernschreiber). [A small patch](https://github.com/tdlib/td/commit/30d912bd4b145afb8d494b307d37645ffa21ec29) is required to make TDLib work properly in all cases. See [the respective TDLib issue](https://github.com/tdlib/td/issues/1343) for more details.
In case you want to use the same codebase which was used to compile the library that is shipped with Fernschreiber, please [check out the fork](https://github.com/Wunderfitz/td), be sure to use the branch `fernschreiber` and compile these sources using the following commands (be sure to have the Sailfish OS build engine running):
- `alias sfdk=~/SailfishOS/bin/sfdk`
- `sfdk config target=SailfishOS-3.3.0.16-armv7hl` (this compiles the sources on SFOS 3.3 and ARM - the target needs to be adjusted according to the running SDK engine and the platform)
- `mkdir build`
- `cd build`
- `sfdk build-shell cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DTD_ENABLE_LTO=ON ..` (in case of compilation issues, try removing the flag `-DTD_ENABLE_LTO=ON`)
- `sfdk build-shell cmake --build . --target install`
You'll find the compiled library in the directory `td/tdlib`.
## Debug
Fernschreiber does only output a few TDLib messages by default. To get its own debug log messages, you can either run a debug build to see all of them or use the environment variable `QT_LOGGING_RULES` to specify/filter which messages you'd like to see.

View file

@ -24,7 +24,23 @@ PhotoTextsListItem {
isSecret: ( chat_type === TelegramAPI.ChatTypeSecret )
openMenuOnPressAndHold: true//chat_id != overviewPage.ownUserId
menu: ContextMenu {
onPressAndHold: {
contextMenuLoader.active = true;
}
Loader {
id: contextMenuLoader
active: false
asynchronous: true
onStatusChanged: {
if(status === Loader.Ready) {
listItem.menu = item;
listItem.openMenu();
}
}
sourceComponent: Component {
ContextMenu {
MenuItem {
visible: unread_count > 0
onClicked: {
@ -59,5 +75,7 @@ PhotoTextsListItem {
text: model.display.type['@type'] === "chatTypePrivate" ? qsTr("User Info") : qsTr("Group Info")
}
}
}
}
}

View file

@ -154,15 +154,6 @@ ChatInformationTabItemBase {
pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ), PageStackAction.Immediate);
pageStack.push(Qt.resolvedUrl("../../pages/ChatPage.qml"), { "chatInformation" : display });
}
Connections {
target: chatListModel
onChatChanged: {
if (changedChatId === chat_id) {
// Force update of some list item elements (currently only last message text seems to create problems). dataChanged() doesn't seem to trigger them all :(
secondaryText.text = last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall) : qsTr("Unknown")
}
}
}
}
}

View file

@ -59,13 +59,13 @@ Page {
Timer {
id: chatListCreatedTimer
interval: 300
interval: 100
running: false
repeat: false
onTriggered: {
overviewPage.chatListCreated = true;
chatListModel.redrawModel();
chatListView.scrollToTop();
updateSecondaryContentTimer.start();
}
}
@ -76,6 +76,15 @@ Page {
pageStack.push(Qt.resolvedUrl("../pages/InitializationPage.qml"));
}
}
Timer {
id: updateSecondaryContentTimer
interval: 600
onTriggered: {
tdLibWrapper.getRecentStickers();
tdLibWrapper.getInstalledStickerSets();
tdLibWrapper.getContacts();
}
}
Timer {
id: searchChatTimer
@ -114,9 +123,6 @@ Page {
function updateContent() {
tdLibWrapper.getChats();
tdLibWrapper.getRecentStickers();
tdLibWrapper.getInstalledStickerSets();
tdLibWrapper.getContacts();
}
function initializePage() {
@ -228,12 +234,6 @@ Page {
}
}
Column {
id: column
width: parent.width
height: parent.height
spacing: Theme.paddingMedium
Row {
id: headerRow
width: parent.width - Theme.horizontalPageMargin
@ -253,7 +253,7 @@ Page {
title: qsTr("Fernschreiber")
width: visible ? ( parent.width - pageStatus.width - searchChatButton.width ) : 0
opacity: visible ? 1 : 0
Behavior on opacity { NumberAnimation {} }
Behavior on opacity { FadeAnimation {} }
}
IconButton {
@ -279,7 +279,7 @@ Page {
id: chatSearchField
visible: false
opacity: visible ? 1 : 0
Behavior on opacity { NumberAnimation {} }
Behavior on opacity { FadeAnimation {} }
width: visible ? ( parent.width - pageStatus.width ) : 0
height: pageHeader.height
placeholderText: qsTr("Search a chat...")
@ -297,42 +297,27 @@ Page {
}
Item {
id: chatListItem
width: parent.width
height: parent.height - Theme.paddingMedium - headerRow.height
SilicaListView {
id: chatListView
anchors.fill: parent
anchors {
top: headerRow.bottom
bottom: parent.bottom
left: parent.left
right: parent.right
}
clip: true
opacity: overviewPage.chatListCreated ? 1 : 0
Behavior on opacity { NumberAnimation {} }
Behavior on opacity { FadeAnimation {} }
model: chatSearchField.text !== "" ? chatListProxyModel : chatListModel
delegate: ChatListViewItem {
ownUserId: overviewPage.ownUserId
isVerified: is_verified
onClicked: {
pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), {
chatInformation : display,
chatPicture: photo_small
})
}
Connections {
target: chatListModel
onChatChanged: {
if (overviewPage.chatListCreated && changedChatId === chat_id) {
// Force update of some list item elements (currently only last message text seems to create problems). dataChanged() doesn't seem to trigger them all :(
secondaryText.text = last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall) : qsTr("Unknown")
}
}
}
}
ViewPlaceholder {
@ -345,12 +330,11 @@ Page {
Column {
width: parent.width
height: loadingLabel.height + loadingBusyIndicator.height + Theme.paddingMedium
spacing: Theme.paddingMedium
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenter: chatListView.verticalCenter
opacity: overviewPage.chatListCreated ? 0 : 1
Behavior on opacity { NumberAnimation {} }
Behavior on opacity { FadeAnimation {} }
visible: !overviewPage.chatListCreated
InfoLabel {
@ -366,6 +350,4 @@ Page {
}
}
}
}
}
}

View file

@ -1300,15 +1300,8 @@ void TDLibWrapper::handleMessageInformation(const QString &messageId, const QVar
QString extraInformation = receivedInformation.value(_EXTRA).toString();
if (extraInformation.startsWith("getChatPinnedMessage")) {
emit chatPinnedMessageUpdated(receivedInformation.value(CHAT_ID).toLongLong(), messageId.toLongLong());
// Sometimes it seems that pinned messages aren't returned as pinned ones, weird!
// This is a workaround for now, let's see what comes out of https://github.com/tdlib/td/issues/1343
QVariantMap updatedInformation(receivedInformation);
updatedInformation.insert("is_pinned", true);
emit receivedMessage(messageId, updatedInformation);
} else {
emit receivedMessage(messageId, receivedInformation);
}
emit receivedMessage(messageId, receivedInformation);
}
void TDLibWrapper::handleMessageIsPinnedUpdated(qlonglong chatId, qlonglong messageId, bool isPinned)

View file

@ -195,10 +195,6 @@
<comment>chats you have in common with a user</comment>
<translation>Lade gemeinsame Chats</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unbekannt</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Lade Gruppenmitglieder</translation>
@ -1014,10 +1010,6 @@
<source>Updating content...</source>
<translation>Aktualisiere Inhalte...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unbekannt</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Lade Chatliste...</translation>

View file

@ -191,10 +191,6 @@
<comment>chats you have in common with a user</comment>
<translation>Loading common chats</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unknown</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Loading group members</translation>
@ -1014,10 +1010,6 @@
<source>Updating content...</source>
<translation>Updating content...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unknown</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Loading chat list...</translation>

View file

@ -188,10 +188,6 @@
<comment>chats you have in common with a user</comment>
<translation>Cargando las charlas comunes</translation>
</message>
<message>
<source>Unknown</source>
<translation>Desconocido</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Cargando miembros del grupo</translation>
@ -1003,10 +999,6 @@
<source>Updating content...</source>
<translation>Actualizando contenido...</translation>
</message>
<message>
<source>Unknown</source>
<translation>desconocido</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>cargando lista de charla...</translation>

View file

@ -191,10 +191,6 @@
<comment>chats you have in common with a user</comment>
<translation>Ladataan yhteisiä keskusteluja...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Tuntematon</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Ladataan ryhmän jäseniä...</translation>
@ -1015,10 +1011,6 @@
<source>Updating content...</source>
<translation>Päivitetään sisältöä...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Tuntematon</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Ladataan keskustelulistaa...</translation>

View file

@ -188,10 +188,6 @@
<comment>chats you have in common with a user</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Ismeretlen</translation>
</message>
<message>
<source>Loading group members</source>
<translation type="unfinished"></translation>
@ -1003,10 +999,6 @@
<source>Updating content...</source>
<translation>Tartalom frissítése...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Ismeretlen</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Csevegés lista betöltése...</translation>

View file

@ -190,10 +190,6 @@
<source>You</source>
<translation>Tu</translation>
</message>
<message>
<source>Unknown</source>
<translation>Sconosciuto</translation>
</message>
<message>
<source>You don&apos;t have any groups in common with this user.</source>
<translation>Non hai nessun gruppo in comune con questo utente.</translation>
@ -998,10 +994,6 @@
<source>Fernschreiber</source>
<translation>Fernschreiber</translation>
</message>
<message>
<source>Unknown</source>
<translation>Sconosciuto</translation>
</message>
<message>
<source>Settings</source>
<translation>Impostazioni</translation>

View file

@ -194,10 +194,6 @@
<comment>chats you have in common with a user</comment>
<translation>Ładowanie wspólnych czatów...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Nieznany</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Ładowanie członków grupy</translation>
@ -1025,10 +1021,6 @@
<source>Updating content...</source>
<translation>Aktualizacja treści...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Nieznany</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Ładowanie listy czatu...</translation>

View file

@ -194,10 +194,6 @@
<comment>chats you have in common with a user</comment>
<translation>Загрузка общих чатов</translation>
</message>
<message>
<source>Unknown</source>
<translation>нет информации</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Загрузка списка участников</translation>
@ -1025,10 +1021,6 @@
<source>Updating content...</source>
<translation>Обновление контента...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Неизвестный</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Загрузка чатов...</translation>

View file

@ -191,10 +191,6 @@
<comment>chats you have in common with a user</comment>
<translation>Läser in gemensamma chattar...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Okänd</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Läser in gruppmedlemmar...</translation>
@ -1014,10 +1010,6 @@
<source>Updating content...</source>
<translation>Uppdaterar innehåll...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Okänd</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Läser in chattlistan...</translation>

View file

@ -188,10 +188,6 @@
<comment>chats you have in common with a user</comment>
<translation></translation>
</message>
<message>
<source>Unknown</source>
<translation></translation>
</message>
<message>
<source>Loading group members</source>
<translation></translation>
@ -1003,10 +999,6 @@
<source>Updating content...</source>
<translation></translation>
</message>
<message>
<source>Unknown</source>
<translation></translation>
</message>
<message>
<source>Loading chat list...</source>
<translation></translation>

View file

@ -191,10 +191,6 @@
<comment>chats you have in common with a user</comment>
<translation>Loading common chats</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unknown</translation>
</message>
<message>
<source>Loading group members</source>
<translation>Loading group members</translation>
@ -1014,10 +1010,6 @@
<source>Updating content...</source>
<translation>Updating content...</translation>
</message>
<message>
<source>Unknown</source>
<translation>Unknown</translation>
</message>
<message>
<source>Loading chat list...</source>
<translation>Loading chat list...</translation>