2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

Allow disabling calls on tdesktop device.

This commit is contained in:
John Preston
2021-01-26 15:58:30 +04:00
parent ce5c19dfe9
commit 7da224d725
6 changed files with 52 additions and 13 deletions

View File

@@ -676,6 +676,23 @@ void SetupNotificationsContent(
Core::App().saveSettingsDelayed();
}, joined->lifetime());
AddSkip(container, st::settingsCheckboxesSkip);
AddDivider(container);
AddSkip(container, st::settingsCheckboxesSkip);
AddSubsectionTitle(
container,
tr::lng_settings_notifications_calls_title());
addCheckbox(
tr::lng_settings_call_accept_calls(tr::now),
!settings.disableCalls()
)->checkedChanges(
) | rpl::filter([&settings](bool value) {
return (settings.disableCalls() == value);
}) | rpl::start_with_next([=](bool value) {
Core::App().settings().setDisableCalls(!value);
Core::App().saveSettingsDelayed();
}, container->lifetime());
const auto nativeText = [&] {
if (!Platform::Notifications::Supported()
|| Platform::Notifications::Enforced()) {