Merge pull request 'upstream_changes' (#13) from upstream_changes into master

Reviewed-on: medvedych/harbour-fernschreiber#13
This commit is contained in:
medvedych 2023-11-21 14:24:05 +03:00
commit f58afe92cb
18 changed files with 134 additions and 64 deletions

3
.gitignore vendored
View file

@ -53,3 +53,6 @@ compile_commands.json
# TDLib API Secrets # TDLib API Secrets
tdlibsecrets.h tdlibsecrets.h
#Convinience scripts
*.sh

View file

@ -133,8 +133,12 @@ ListItem {
if (messageListItem.messageReactions) { if (messageListItem.messageReactions) {
messageListItem.messageReactions = null; messageListItem.messageReactions = null;
} else if (messageListItem.chatReactions) { } else if (messageListItem.chatReactions) {
Debug.log("Using chat reactions")
messageListItem.messageReactions = chatReactions messageListItem.messageReactions = chatReactions
showItemCompletelyTimer.requestedIndex = index;
showItemCompletelyTimer.start();
} else { } else {
Debug.log("Obtaining message reactions")
tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId); tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId);
} }
} }
@ -279,6 +283,7 @@ ListItem {
interval: 200 interval: 200
triggeredOnStart: false triggeredOnStart: false
onTriggered: { onTriggered: {
Debug.log("Show item completely timer triggered, requested index: " + requestedIndex + ", current index: " + index)
if (requestedIndex === index) { if (requestedIndex === index) {
chatView.highlightMoveDuration = -1; chatView.highlightMoveDuration = -1;
chatView.highlightResizeDuration = -1; chatView.highlightResizeDuration = -1;

View file

@ -159,7 +159,8 @@ AccordionItem {
ComboBox { ComboBox {
readonly property int ttl: activeSessionsItem.inactiveSessionsTtlDays 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) value: (currentItem && currentItem.text) ? currentItem.text : qsTr("%1 day(s)", "", ttl).arg(ttl)
visible: ttl > 0 visible: ttl > 0
menu: ContextMenu { menu: ContextMenu {

View file

@ -127,6 +127,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren
handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup); handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup);
handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated); handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated);
handlers.insert("messages", &TDLibReceiver::processMessages); handlers.insert("messages", &TDLibReceiver::processMessages);
handlers.insert("foundChatMessages", &TDLibReceiver::processFoundChatMessages);
handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); // TdLib <= 1.8.7 handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); // TdLib <= 1.8.7
handlers.insert("sponsoredMessages", &TDLibReceiver::processSponsoredMessages); // TdLib >= 1.8.8 handlers.insert("sponsoredMessages", &TDLibReceiver::processSponsoredMessages); // TdLib >= 1.8.8
handlers.insert("updateNewMessage", &TDLibReceiver::processUpdateNewMessage); handlers.insert("updateNewMessage", &TDLibReceiver::processUpdateNewMessage);
@ -390,6 +391,13 @@ void TDLibReceiver::processMessages(const QVariantMap &receivedInformation)
emit messagesReceived(cleanupList(receivedInformation.value(MESSAGES).toList()), total_count); 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) void TDLibReceiver::processSponsoredMessage(const QVariantMap &receivedInformation)
{ {
// TdLib <= 1.8.7 // TdLib <= 1.8.7

View file

@ -139,6 +139,7 @@ private:
void processUpdateSuperGroup(const QVariantMap &receivedInformation); void processUpdateSuperGroup(const QVariantMap &receivedInformation);
void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation); void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation);
void processMessages(const QVariantMap &receivedInformation); void processMessages(const QVariantMap &receivedInformation);
void processFoundChatMessages(const QVariantMap &receivedInformation);
void processSponsoredMessage(const QVariantMap &receivedInformation); void processSponsoredMessage(const QVariantMap &receivedInformation);
void processSponsoredMessages(const QVariantMap &receivedInformation); void processSponsoredMessages(const QVariantMap &receivedInformation);
void processUpdateNewMessage(const QVariantMap &receivedInformation); void processUpdateNewMessage(const QVariantMap &receivedInformation);

View file

@ -1704,36 +1704,40 @@
<source>Sessions</source> <source>Sessions</source>
<translation>Sitzungen</translation> <translation>Sitzungen</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation>
<numerusform></numerusform> <numerusform>%1 Tag</numerusform>
<numerusform></numerusform> <numerusform>%1 Tage</numerusform>
</translation> </translation>
</message> </message>
<message> <message>
<source>1 week</source> <source>1 week</source>
<translation type="unfinished"></translation> <translation>1 Woche</translation>
</message> </message>
<message> <message>
<source>1 month</source> <source>1 month</source>
<translation type="unfinished"></translation> <translation>1 Monat</translation>
</message> </message>
<message> <message>
<source>3 months</source> <source>3 months</source>
<translation type="unfinished"></translation> <translation>3 Monate</translation>
</message> </message>
<message> <message>
<source>6 months</source> <source>6 months</source>
<translation type="unfinished"></translation> <translation>6 Monate</translation>
</message> </message>
<message> <message>
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation>1 Jahr</translation>
</message>
<message>
<source>Session Timeout</source>
<translation>Timeout von Sitzungen</translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation>Inaktive Sitzungen werden nach dieser Zeitdauer abgeschaltet</translation>
</message> </message>
</context> </context>
<context> <context>

View file

@ -1706,15 +1706,11 @@ messages</numerusform>
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Active since: %1, last online: %2</translation> <translation>Active since: %1, last online: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation>
<numerusform></numerusform> <numerusform>%1 day</numerusform>
<numerusform></numerusform> <numerusform>%1 days</numerusform>
</translation> </translation>
</message> </message>
<message> <message>
@ -1737,6 +1733,14 @@ messages</numerusform>
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1704,10 +1704,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Activo desde: %1, último en línea: %2</translation> <translation>Activo desde: %1, último en línea: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1735,6 +1731,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1705,10 +1705,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Aktiivinen %1 alkaen, viimeksi paikalla: %2</translation> <translation>Aktiivinen %1 alkaen, viimeksi paikalla: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1736,6 +1732,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1704,10 +1704,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Actif depuis : %1, en ligne : %2</translation> <translation>Actif depuis : %1, en ligne : %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1735,6 +1731,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1677,10 +1677,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1707,6 +1703,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1704,10 +1704,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1735,6 +1731,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1731,10 +1731,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Aktywny od: %1, ostatnio aktywny: %2</translation> <translation>Aktywny od: %1, ostatnio aktywny: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1763,6 +1759,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1734,10 +1734,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Активен с: %1, был онлайн: %2</translation> <translation>Активен с: %1, был онлайн: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1766,6 +1762,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1731,10 +1731,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Aktívna od: %1, naposledy pripojená: %2</translation> <translation>Aktívna od: %1, naposledy pripojená: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1763,6 +1759,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1704,10 +1704,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>Aktiv sedan: %1, senast online: %2</translation> <translation>Aktiv sedan: %1, senast online: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1735,6 +1731,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1678,10 +1678,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation>: %1, 线: %2</translation> <translation>: %1, 线: %2</translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1708,6 +1704,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>

View file

@ -1704,10 +1704,6 @@
<source>Active since: %1, last online: %2</source> <source>Active since: %1, last online: %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Terminate old sessions if inactive for</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes"> <message numerus="yes">
<source>%1 day(s)</source> <source>%1 day(s)</source>
<translation type="unfinished"> <translation type="unfinished">
@ -1735,6 +1731,14 @@
<source>1 year</source> <source>1 year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SettingsStorage</name> <name>SettingsStorage</name>