mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Add 'Count unread messages' option.
This commit is contained in:
@@ -545,7 +545,10 @@ void SetupNotificationsContent(not_null<Ui::VerticalLayout*> container) {
|
||||
Global::SoundNotify());
|
||||
const auto muted = addCheckbox(
|
||||
lng_settings_include_muted,
|
||||
Global::IncludeMuted());
|
||||
Auth().settings().includeMutedCounter());
|
||||
const auto count = addCheckbox(
|
||||
lng_settings_count_unread,
|
||||
Auth().settings().countUnreadMessages());
|
||||
|
||||
const auto nativeNotificationsKey = [&] {
|
||||
if (!Platform::Notifications::Supported()) {
|
||||
@@ -644,12 +647,21 @@ void SetupNotificationsContent(not_null<Ui::VerticalLayout*> container) {
|
||||
base::ObservableViewer(
|
||||
muted->checkedChanged
|
||||
) | rpl::filter([](bool checked) {
|
||||
return (checked != Global::IncludeMuted());
|
||||
return (checked != Auth().settings().includeMutedCounter());
|
||||
}) | rpl::start_with_next([=](bool checked) {
|
||||
Global::SetIncludeMuted(checked);
|
||||
Auth().settings().setIncludeMutedCounter(checked);
|
||||
changed(Change::IncludeMuted);
|
||||
}, muted->lifetime());
|
||||
|
||||
base::ObservableViewer(
|
||||
count->checkedChanged
|
||||
) | rpl::filter([](bool checked) {
|
||||
return (checked != Auth().settings().countUnreadMessages());
|
||||
}) | rpl::start_with_next([=](bool checked) {
|
||||
Auth().settings().setCountUnreadMessages(checked);
|
||||
changed(Change::CountMessages);
|
||||
}, muted->lifetime());
|
||||
|
||||
base::ObservableViewer(
|
||||
Auth().notifications().settingsChanged()
|
||||
) | rpl::start_with_next([=](Change change) {
|
||||
|
Reference in New Issue
Block a user