From 63ce0f92d2c3862f08eb965a39cbf417374cd2cd Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Fri, 13 Nov 2020 22:42:48 +0100 Subject: [PATCH] Fix 'mute chat' for chats that have never been muted, fixes #144 --- qml/components/ChatListViewItem.qml | 1 + qml/pages/ChatInformationPage.qml | 1 + qml/pages/ChatPage.qml | 1 + 3 files changed, 3 insertions(+) diff --git a/qml/components/ChatListViewItem.qml b/qml/components/ChatListViewItem.qml index c93758c..9578d51 100644 --- a/qml/components/ChatListViewItem.qml +++ b/qml/components/ChatListViewItem.qml @@ -41,6 +41,7 @@ PhotoTextsListItem { } else { newNotificationSettings.mute_for = 6666666; } + newNotificationSettings.use_default_mute_for = false; tdLibWrapper.setChatNotificationSettings(chat_id, newNotificationSettings); } text: display.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat") diff --git a/qml/pages/ChatInformationPage.qml b/qml/pages/ChatInformationPage.qml index 6efc4d0..cd1f060 100644 --- a/qml/pages/ChatInformationPage.qml +++ b/qml/pages/ChatInformationPage.qml @@ -212,6 +212,7 @@ Page { } else { newNotificationSettings.mute_for = 6666666; } + newNotificationSettings.use_default_mute_for = false; tdLibWrapper.setChatNotificationSettings(chat_id, newNotificationSettings); } text: chatInformation.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat") diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 174ec2b..a4efe3f 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -412,6 +412,7 @@ Page { } else { newNotificationSettings.mute_for = 6666666; } + newNotificationSettings.use_default_mute_for = false; tdLibWrapper.setChatNotificationSettings(chatInformation.id, newNotificationSettings); } text: chatInformation.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat")