mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix non-available API usage in OS X 10.6-10.7 version.
This commit is contained in:
@@ -43,8 +43,13 @@ void queryDoNotDisturbState() {
|
||||
}
|
||||
LastSettingsQueryMs = ms;
|
||||
|
||||
id userDefaultsValue = [[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.notificationcenterui"] objectForKey:@"doNotDisturb"];
|
||||
DoNotDisturbEnabled = [userDefaultsValue boolValue];
|
||||
auto userDefaults = [NSUserDefaults alloc];
|
||||
if ([userDefaults respondsToSelector:@selector(initWithSuiteName:)]) {
|
||||
id userDefaultsValue = [[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.notificationcenterui_test"] objectForKey:@"doNotDisturb"];
|
||||
DoNotDisturbEnabled = ([userDefaultsValue boolValue] == YES);
|
||||
} else {
|
||||
DoNotDisturbEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
using Manager = Platform::Notifications::Manager;
|
||||
|
||||
@@ -60,7 +60,7 @@ void System::createManager() {
|
||||
void System::schedule(History *history, HistoryItem *item) {
|
||||
if (App::quitting() || !history->currentNotification() || !App::api()) return;
|
||||
|
||||
PeerData *notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : 0;
|
||||
auto notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : nullptr;
|
||||
|
||||
if (item->isSilent()) {
|
||||
history->popNotification(item);
|
||||
|
||||
Reference in New Issue
Block a user