From a28b9df6b52ffd6fcea9acfb12f434d0b303db4d Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sun, 19 Nov 2023 22:51:33 +0100 Subject: [PATCH 1/4] Minor tweaks for the new session timout setting --- .../settingsPage/SettingsSession.qml | 3 +- translations/harbour-fernschreiber-de.ts | 28 +++++++++++-------- translations/harbour-fernschreiber-en.ts | 18 +++++++----- translations/harbour-fernschreiber-es.ts | 12 +++++--- translations/harbour-fernschreiber-fi.ts | 12 +++++--- translations/harbour-fernschreiber-fr.ts | 12 +++++--- translations/harbour-fernschreiber-hu.ts | 12 +++++--- translations/harbour-fernschreiber-it.ts | 12 +++++--- translations/harbour-fernschreiber-pl.ts | 12 +++++--- translations/harbour-fernschreiber-ru.ts | 12 +++++--- translations/harbour-fernschreiber-sk.ts | 12 +++++--- translations/harbour-fernschreiber-sv.ts | 12 +++++--- translations/harbour-fernschreiber-zh_CN.ts | 12 +++++--- translations/harbour-fernschreiber.ts | 12 +++++--- 14 files changed, 117 insertions(+), 64 deletions(-) diff --git a/qml/components/settingsPage/SettingsSession.qml b/qml/components/settingsPage/SettingsSession.qml index cb65cf8..e94b2ca 100644 --- a/qml/components/settingsPage/SettingsSession.qml +++ b/qml/components/settingsPage/SettingsSession.qml @@ -159,7 +159,8 @@ AccordionItem { ComboBox { readonly property int ttl: activeSessionsItem.inactiveSessionsTtlDays - label: qsTr("Terminate old sessions if inactive for") + label: qsTr("Session Timeout") + description: qsTr("Inactive sessions will be terminated after this timeframe") value: (currentItem && currentItem.text) ? currentItem.text : qsTr("%1 day(s)", "", ttl).arg(ttl) visible: ttl > 0 menu: ContextMenu { diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 4359431..489417e 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1704,36 +1704,40 @@ Sessions Sitzungen - - Terminate old sessions if inactive for - - %1 day(s) - - - + + %1 Tag + %1 Tage 1 week - + 1 Woche 1 month - + 1 Monat 3 months - + 3 Monate 6 months - + 6 Monate 1 year - + 1 Jahr + + + Session Timeout + Timeout von Sitzungen + + + Inactive sessions will be terminated after this timeframe + Inaktive Sitzungen werden nach dieser Zeitdauer abgeschaltet diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index fd4880b..2be078c 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1706,15 +1706,11 @@ messages Active since: %1, last online: %2 Active since: %1, last online: %2 - - Terminate old sessions if inactive for - - %1 day(s) - - - + + %1 day + %1 days @@ -1737,6 +1733,14 @@ messages 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index b342d05..3e18a9b 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -1704,10 +1704,6 @@ Active since: %1, last online: %2 Activo desde: %1, último en línea: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1735,6 +1731,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index 86538d5..1844a7a 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1705,10 +1705,6 @@ Active since: %1, last online: %2 Aktiivinen %1 alkaen, viimeksi paikalla: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1736,6 +1732,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-fr.ts b/translations/harbour-fernschreiber-fr.ts index 71bdeb8..3e2f87d 100644 --- a/translations/harbour-fernschreiber-fr.ts +++ b/translations/harbour-fernschreiber-fr.ts @@ -1704,10 +1704,6 @@ Active since: %1, last online: %2 Actif depuis : %1, en ligne : %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1735,6 +1731,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 3cb6616..ae8f9f0 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1677,10 +1677,6 @@ Active since: %1, last online: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1707,6 +1703,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index b68a0d0..984d369 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1704,10 +1704,6 @@ Active since: %1, last online: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1735,6 +1731,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index d4a1cf9..dde307f 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1731,10 +1731,6 @@ Active since: %1, last online: %2 Aktywny od: %1, ostatnio aktywny: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1763,6 +1759,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 125ba7c..5fd1393 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1734,10 +1734,6 @@ Active since: %1, last online: %2 Активен с: %1, был онлайн: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1766,6 +1762,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index 1a97fe2..64c9d41 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -1731,10 +1731,6 @@ Active since: %1, last online: %2 Aktívna od: %1, naposledy pripojená: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1763,6 +1759,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index 705125b..a8b3ec7 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1704,10 +1704,6 @@ Active since: %1, last online: %2 Aktiv sedan: %1, senast online: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1735,6 +1731,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index d5fa60d..89f248d 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1678,10 +1678,6 @@ Active since: %1, last online: %2 活跃时间: %1, 上次在线: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1708,6 +1704,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 69001f7..f39583e 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1704,10 +1704,6 @@ Active since: %1, last online: %2 - - Terminate old sessions if inactive for - - %1 day(s) @@ -1735,6 +1731,14 @@ 1 year + + Session Timeout + + + + Inactive sessions will be terminated after this timeframe + + SettingsStorage From 026d32c92a21ff3b7a0b977bf86f7325ae1b06e1 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Mon, 20 Nov 2023 21:27:55 +0100 Subject: [PATCH 2/4] Restore search in chats --- qml/components/MessageListViewItem.qml | 2 ++ src/tdlibreceiver.cpp | 8 ++++++++ src/tdlibreceiver.h | 1 + 3 files changed, 11 insertions(+) diff --git a/qml/components/MessageListViewItem.qml b/qml/components/MessageListViewItem.qml index d8a4944..533c2b2 100644 --- a/qml/components/MessageListViewItem.qml +++ b/qml/components/MessageListViewItem.qml @@ -133,8 +133,10 @@ ListItem { if (messageListItem.messageReactions) { messageListItem.messageReactions = null; } else if (messageListItem.chatReactions) { + Debug.log("Using chat reactions") messageListItem.messageReactions = chatReactions } else { + Debug.log("Obtaining message reactions") tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId); } } diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index f14eeeb..8f65952 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -127,6 +127,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup); handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated); handlers.insert("messages", &TDLibReceiver::processMessages); + handlers.insert("foundChatMessages", &TDLibReceiver::processFoundChatMessages); handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); // TdLib <= 1.8.7 handlers.insert("sponsoredMessages", &TDLibReceiver::processSponsoredMessages); // TdLib >= 1.8.8 handlers.insert("updateNewMessage", &TDLibReceiver::processUpdateNewMessage); @@ -390,6 +391,13 @@ void TDLibReceiver::processMessages(const QVariantMap &receivedInformation) emit messagesReceived(cleanupList(receivedInformation.value(MESSAGES).toList()), total_count); } +void TDLibReceiver::processFoundChatMessages(const QVariantMap &receivedInformation) +{ + const int total_count = receivedInformation.value(TOTAL_COUNT).toInt(); + LOG("Received found chat messages, amount: " << total_count); + emit messagesReceived(cleanupList(receivedInformation.value(MESSAGES).toList()), total_count); +} + void TDLibReceiver::processSponsoredMessage(const QVariantMap &receivedInformation) { // TdLib <= 1.8.7 diff --git a/src/tdlibreceiver.h b/src/tdlibreceiver.h index cf6558c..bfb380e 100644 --- a/src/tdlibreceiver.h +++ b/src/tdlibreceiver.h @@ -139,6 +139,7 @@ private: void processUpdateSuperGroup(const QVariantMap &receivedInformation); void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation); void processMessages(const QVariantMap &receivedInformation); + void processFoundChatMessages(const QVariantMap &receivedInformation); void processSponsoredMessage(const QVariantMap &receivedInformation); void processSponsoredMessages(const QVariantMap &receivedInformation); void processUpdateNewMessage(const QVariantMap &receivedInformation); From 1e88a31f908a64c7d131b47a0bae6ae6dd2d41cf Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Mon, 20 Nov 2023 21:53:57 +0100 Subject: [PATCH 3/4] Display reactions on last message again --- qml/components/MessageListViewItem.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qml/components/MessageListViewItem.qml b/qml/components/MessageListViewItem.qml index 533c2b2..92a388c 100644 --- a/qml/components/MessageListViewItem.qml +++ b/qml/components/MessageListViewItem.qml @@ -135,6 +135,8 @@ ListItem { } else if (messageListItem.chatReactions) { Debug.log("Using chat reactions") messageListItem.messageReactions = chatReactions + showItemCompletelyTimer.requestedIndex = index; + showItemCompletelyTimer.start(); } else { Debug.log("Obtaining message reactions") tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId); @@ -281,6 +283,7 @@ ListItem { interval: 200 triggeredOnStart: false onTriggered: { + Debug.log("Show item completely timer triggered, requested index: " + requestedIndex + ", current index: " + index) if (requestedIndex === index) { chatView.highlightMoveDuration = -1; chatView.highlightResizeDuration = -1; From 2b3ca0dff94b2d047fb1bf68f0865d2493b2d037 Mon Sep 17 00:00:00 2001 From: Denis Fedoseev Date: Tue, 21 Nov 2023 14:23:24 +0300 Subject: [PATCH 4/4] Update gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1184900..fbb2bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ compile_commands.json # TDLib API Secrets tdlibsecrets.h + +#Convinience scripts +*.sh