From 57f0158ade7bcc2a8eb791caa94ebe0ed69c0967 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 May 2017 17:40:46 +0300 Subject: [PATCH] Disable quiet hours check in Windows before 10. We had several reports about wrong values in registry on Windows 8.1, like the quiet hours are enabled and all notifications are skipped, without anything like that being enabled in Windows settings. --- .../platform/win/notifications_manager_win.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/win/notifications_manager_win.cpp b/Telegram/SourceFiles/platform/win/notifications_manager_win.cpp index fb28ebc046..1c67bf2997 100644 --- a/Telegram/SourceFiles/platform/win/notifications_manager_win.cpp +++ b/Telegram/SourceFiles/platform/win/notifications_manager_win.cpp @@ -597,9 +597,13 @@ namespace { bool QuietHoursEnabled = false; DWORD QuietHoursValue = 0; +// Thanks https://stackoverflow.com/questions/35600128/get-windows-quiet-hours-from-win32-or-c-sharp-api void queryQuietHours() { - if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8_1) { - // No system quiet hours in Windows prior to Windows 8.1 + if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS10) { + // There are quiet hours in Windows starting from Windows 8.1 + // But there were several reports about the notifications being shut + // down according to the registry while no quiet hours were enabled. + // So we try this method only starting with Windows 10. return; }