Merge pull request 'upstream_changes_251123' (#14) from upstream_changes_251123 into master

Reviewed-on: #14
This commit is contained in:
medvedych 2023-11-25 13:50:00 +03:00
commit 062f5d3811
20 changed files with 398 additions and 272 deletions

View file

@ -132,7 +132,12 @@ ListItem {
if (messageListItem.messageReactions) {
messageListItem.messageReactions = null;
} else if (messageListItem.chatReactions) {
}
}
}
onDoubleClicked: {
if (messageListItem.chatReactions) {
Debug.log("Using chat reactions")
messageListItem.messageReactions = chatReactions
showItemCompletelyTimer.requestedIndex = index;
@ -142,7 +147,6 @@ ListItem {
tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId);
}
}
}
onPressAndHold: {
if (openMenuOnPressAndHold) {

View file

@ -108,27 +108,38 @@ ListItem {
}
Rectangle {
id: chatUnreadReactionCountBackground
color: isMuted ? ((Theme.colorScheme === Theme.DarkOnLight) ? "lightgray" : "dimgray") : Theme.highlightBackgroundColor
width: Theme.fontSizeLarge
height: Theme.fontSizeLarge
anchors.right: parent.right
anchors.top: parent.top
radius: parent.width / 2
visible: chatListViewItem.unreadReactionCount > 0
}
visible: chatListViewItem.unreadReactionCount > 0 || chatListViewItem.unreadMentionCount > 0
Icon {
source: "image://theme/icon-s-favorite"
height: Theme.iconSizeExtraSmall
width: Theme.iconSizeExtraSmall
highlighted: chatListViewItem.highlighted
anchors.centerIn: chatUnreadReactionCountBackground
visible: chatListViewItem.unreadReactionCount > 0
anchors.centerIn: parent
visible: chatListViewItem.unreadReactionCount > 0 && !chatListViewItem.unreadMentionCount
}
Text {
font {
pixelSize: Theme.iconSizeExtraSmall
bold: true
}
color: Theme.primaryColor
anchors.centerIn: parent
visible: chatListViewItem.unreadMentionCount > 0
opacity: isMuted ? Theme.opacityHigh : 1.0
text: "@"
}
}
}
}
Column {
id: contentColumn
anchors {

View file

@ -609,6 +609,15 @@ Page {
chatViewCooldownTimer.restart();
chatViewStartupReadTimer.restart();
var remainingDoubleTapHints = appSettings.remainingDoubleTapHints;
Debug.log("Remaining double tap hints: " + remainingDoubleTapHints);
if (remainingDoubleTapHints > 0) {
doubleTapHintTimer.start();
tapHint.visible = true;
tapHintLabel.visible = true;
appSettings.remainingDoubleTapHints = remainingDoubleTapHints - 1;
}
}
onNewMessageReceived: {
if (( chatView.manuallyScrolledToBottom && Qt.application.state === Qt.ApplicationActive ) || message.sender_id.user_id === chatPage.myUserId) {
@ -2157,4 +2166,31 @@ Page {
}
}
}
Timer {
id: doubleTapHintTimer
running: true
triggeredOnStart: false
repeat: false
interval: 6000
onTriggered: {
tapHint.visible = false;
tapHintLabel.visible = false;
}
}
TapInteractionHint {
id: tapHint
loops: Animation.Infinite
taps: 2
anchors.centerIn: parent
visible: false
}
InteractionHintLabel {
id: tapHintLabel
anchors.bottom: parent.bottom
text: qsTr("Double-tap on a message to choose a reaction")
visible: false
}
}

View file

@ -12,7 +12,7 @@ Name: harbour-fernschreiber
Summary: Fernschreiber is a Telegram client for Aurora OS
Version: 0.17
Release: 6
Release: 7
Group: Qt/Qt
License: LICENSE
URL: http://werkwolf.eu/

View file

@ -35,6 +35,7 @@ namespace {
const QString KEY_STORAGE_OPTIMIZER("useStorageOptimizer");
const QString KEY_INLINEBOT_LOCATION_ACCESS("allowInlineBotLocationAccess");
const QString KEY_REMAINING_INTERACTION_HINTS("remainingInteractionHints");
const QString KEY_REMAINING_DOUBLE_TAP_HINTS("remainingDoubleTapHints");
const QString KEY_ONLINE_ONLY_MODE("onlineOnlyMode");
const QString KEY_DELAY_MESSAGE_READ("delayMessageRead");
const QString KEY_FOCUS_TEXTAREA_ON_CHAT_OPEN("focusTextAreaOnChatOpen");
@ -243,6 +244,20 @@ void AppSettings::setRemainingInteractionHints(int remainingHints)
}
}
int AppSettings::remainingDoubleTapHints() const
{
return settings.value(KEY_REMAINING_DOUBLE_TAP_HINTS, 3).toInt();
}
void AppSettings::setRemainingDoubleTapHints(int remainingHints)
{
if (remainingDoubleTapHints() != remainingHints) {
LOG(KEY_REMAINING_DOUBLE_TAP_HINTS << remainingHints);
settings.setValue(KEY_REMAINING_DOUBLE_TAP_HINTS, remainingHints);
emit remainingDoubleTapHintsChanged();
}
}
bool AppSettings::onlineOnlyMode() const
{
return settings.value(KEY_ONLINE_ONLY_MODE, false).toBool();

View file

@ -38,6 +38,7 @@ class AppSettings : public QObject {
Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged)
Q_PROPERTY(bool allowInlineBotLocationAccess READ allowInlineBotLocationAccess WRITE setAllowInlineBotLocationAccess NOTIFY allowInlineBotLocationAccessChanged)
Q_PROPERTY(int remainingInteractionHints READ remainingInteractionHints WRITE setRemainingInteractionHints NOTIFY remainingInteractionHintsChanged)
Q_PROPERTY(int remainingDoubleTapHints READ remainingDoubleTapHints WRITE setRemainingDoubleTapHints NOTIFY remainingDoubleTapHintsChanged)
Q_PROPERTY(bool onlineOnlyMode READ onlineOnlyMode WRITE setOnlineOnlyMode NOTIFY onlineOnlyModeChanged)
Q_PROPERTY(bool delayMessageRead READ delayMessageRead WRITE setDelayMessageRead NOTIFY delayMessageReadChanged)
Q_PROPERTY(bool focusTextAreaOnChatOpen READ getFocusTextAreaOnChatOpen WRITE setFocusTextAreaOnChatOpen NOTIFY focusTextAreaOnChatOpenChanged)
@ -104,6 +105,9 @@ public:
int remainingInteractionHints() const;
void setRemainingInteractionHints(int remainingHints);
int remainingDoubleTapHints() const;
void setRemainingDoubleTapHints(int remainingHints);
bool onlineOnlyMode() const;
void setOnlineOnlyMode(bool enable);
@ -134,6 +138,7 @@ signals:
void storageOptimizerChanged();
void allowInlineBotLocationAccessChanged();
void remainingInteractionHintsChanged();
void remainingDoubleTapHintsChanged();
void onlineOnlyModeChanged();
void delayMessageReadChanged();
void focusTextAreaOnChatOpenChanged();

View file

@ -175,6 +175,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren
handlers.insert("updateMessageInteractionInfo", &TDLibReceiver::processUpdateMessageInteractionInfo);
handlers.insert("sessions", &TDLibReceiver::processSessions);
handlers.insert("availableReactions", &TDLibReceiver::processAvailableReactions);
handlers.insert("updateMessageMentionRead", &TDLibReceiver::processUpdateChatUnreadMentionCount);
handlers.insert("updateChatUnreadMentionCount", &TDLibReceiver::processUpdateChatUnreadMentionCount);
handlers.insert("updateChatUnreadReactionCount", &TDLibReceiver::processUpdateChatUnreadReactionCount);
handlers.insert("updateActiveEmojiReactions", &TDLibReceiver::processUpdateActiveEmojiReactions);
@ -736,6 +737,8 @@ void TDLibReceiver::processAvailableReactions(const QVariantMap &receivedInforma
void TDLibReceiver::processUpdateChatUnreadMentionCount(const QVariantMap &receivedInformation)
{
// Handles both updateMessageMentionRead and updateChatUnreadMentionCount
// They both have chat_id and unread_mention_count which is all we need
const qlonglong chatId = receivedInformation.value(CHAT_ID).toLongLong();
const int unreadMentionCount = receivedInformation.value(UNREAD_MENTION_COUNT).toInt();
LOG("Chat unread mention count updated" << chatId << unreadMentionCount);

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation>Gelöschtes Konto</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation>Drücke zweimal auf eine Nachricht, um eine Reaktion auszuwählen</translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation>Deleted User</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

File diff suppressed because it is too large Load diff

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<TS version="2.1" language="fr">
<context>
<name>AboutPage</name>
<message>
@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation>Supprimer l&apos;utilisateur</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation>Toucher deux fois sur un message pour réagir</translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>
@ -1159,7 +1163,7 @@
</message>
<message>
<source>No contacts found.</source>
<translation type="unfinished"></translation>
<translation>Aucun contact trouvé</translation>
</message>
</context>
<context>
@ -1577,23 +1581,23 @@
</message>
<message>
<source>Always append message preview to notifications</source>
<translation type="unfinished"></translation>
<translation>Toujours visualiser le message dans les notifications</translation>
</message>
<message>
<source>In addition to showing the number of unread messages, the latest message will also be appended to notifications.</source>
<translation type="unfinished"></translation>
<translation>En plus d&apos;afficher le nombre de messages non-lus, le dernier message sera également ajouté aux notifications.</translation>
</message>
<message>
<source>Highlight unread messages</source>
<translation type="unfinished"></translation>
<translation>Mettre en valeur les messages non-lus</translation>
</message>
<message>
<source>Highlight Conversations with unread messages</source>
<translation type="unfinished"></translation>
<translation>Mettre en valeur les conversations avec des messages non-lus</translation>
</message>
<message>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
<translation>Masquer le contenu dans les notifications</translation>
</message>
</context>
<context>
@ -1706,38 +1710,38 @@
</message>
<message numerus="yes">
<source>%1 day(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<translation>
<numerusform>%1 jour(s)</numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>1 week</source>
<translation type="unfinished"></translation>
<translation>1 semaine</translation>
</message>
<message>
<source>1 month</source>
<translation type="unfinished"></translation>
<translation>1 mois</translation>
</message>
<message>
<source>3 months</source>
<translation type="unfinished"></translation>
<translation>3 mois</translation>
</message>
<message>
<source>6 months</source>
<translation type="unfinished"></translation>
<translation>6 mois</translation>
</message>
<message>
<source>1 year</source>
<translation type="unfinished"></translation>
<translation>1 année</translation>
</message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
<translation>Délai d&apos;inactivité de session</translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
<translation>Sessions inactives seront terminées après ce délai</translation>
</message>
</context>
<context>

View file

@ -473,6 +473,10 @@
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -493,6 +493,10 @@
<source>Deleted User</source>
<translation>Usunięty użytkownik</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -348,11 +348,11 @@
</message>
<message>
<source>Leave Chat</source>
<translation>Выйти из Чата</translation>
<translation>Выйти из чата</translation>
</message>
<message>
<source>Join Chat</source>
<translation>Зайти в Чат</translation>
<translation>Зайти в чат</translation>
</message>
<message>
<source>Leaving chat</source>
@ -427,7 +427,7 @@
</message>
<message>
<source>Search in Chat</source>
<translation>Найти в Чате</translation>
<translation>Поиск в чате</translation>
</message>
<message>
<source>Search in chat...</source>
@ -493,6 +493,10 @@
<source>Deleted User</source>
<translation>Удалённый пользователь</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>
@ -1152,7 +1156,7 @@
</message>
<message>
<source>Secret Chat</source>
<translation>Секретный Чат</translation>
<translation>Секретный чат</translation>
</message>
<message>
<source>End-to-end-encrypted, accessible on this device only</source>
@ -1234,7 +1238,7 @@
</message>
<message>
<source>New Chat</source>
<translation>Новый Чат</translation>
<translation>Новый чат</translation>
</message>
<message>
<source>Filter your chats...</source>
@ -1242,7 +1246,7 @@
</message>
<message>
<source>Search Chats</source>
<translation>Найти Чаты</translation>
<translation>Поиск чатов</translation>
</message>
<message>
<source>Download of %1 successful.</source>
@ -1453,7 +1457,7 @@
<name>SearchChatsPage</name>
<message>
<source>No chats found.</source>
<translation>Чаты не найдены</translation>
<translation>Ничего не найдено</translation>
</message>
<message>
<source>Searching chats...</source>
@ -1461,7 +1465,7 @@
</message>
<message>
<source>Private Chat</source>
<translation>Приватный Чат</translation>
<translation>Приватный чат</translation>
</message>
<message>
<source>Group</source>
@ -1489,7 +1493,7 @@
</message>
<message>
<source>Search Chats</source>
<translation>Найти Чаты</translation>
<translation>Поиск чатов</translation>
</message>
<message>
<source>Search a chat...</source>
@ -1607,23 +1611,23 @@
</message>
<message>
<source>Always append message preview to notifications</source>
<translation type="unfinished"></translation>
<translation>Всегда показывать последнее сообщение на экране событий</translation>
</message>
<message>
<source>In addition to showing the number of unread messages, the latest message will also be appended to notifications.</source>
<translation type="unfinished"></translation>
<translation>Включать в текст на экране событий не только количество непрочитанных сообщений, но и содержимое последнего сообщения.</translation>
</message>
<message>
<source>Highlight unread messages</source>
<translation type="unfinished"></translation>
<translation>Выделять непрочитанные сообщения</translation>
</message>
<message>
<source>Highlight Conversations with unread messages</source>
<translation type="unfinished"></translation>
<translation>Помечать чаты и каналы с непрочитанными сообщениями другим шрифтом и цветом.</translation>
</message>
<message>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
<translation>Не показывать содержимое сообщений в уведомлениях</translation>
</message>
</context>
<context>
@ -1736,39 +1740,39 @@
</message>
<message numerus="yes">
<source>%1 day(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
<numerusform></numerusform>
<translation>
<numerusform>%1 день</numerusform>
<numerusform>%1 дня</numerusform>
<numerusform>%1 дней</numerusform>
</translation>
</message>
<message>
<source>1 week</source>
<translation type="unfinished"></translation>
<translation>1 неделя</translation>
</message>
<message>
<source>1 month</source>
<translation type="unfinished"></translation>
<translation>1 месяц</translation>
</message>
<message>
<source>3 months</source>
<translation type="unfinished"></translation>
<translation>3 месяца</translation>
</message>
<message>
<source>6 months</source>
<translation type="unfinished"></translation>
<translation>6 месяцев</translation>
</message>
<message>
<source>1 year</source>
<translation type="unfinished"></translation>
<translation>1 год</translation>
</message>
<message>
<source>Session Timeout</source>
<translation type="unfinished"></translation>
<translation>Таймаут неактивности</translation>
</message>
<message>
<source>Inactive sessions will be terminated after this timeframe</source>
<translation type="unfinished"></translation>
<translation>Неактивные сеансы будут автоматически завершены через указанное время.</translation>
</message>
</context>
<context>

View file

@ -493,6 +493,10 @@
<source>Deleted User</source>
<translation>Odstránený používateľ</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation>Tog bort användare</translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -473,6 +473,10 @@
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -483,6 +483,10 @@
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double-tap on a message to choose a reaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>