mirror of https://github.com/procxx/kepka.git
Fix non-available API usage in OS X 10.6-10.7 version.
This commit is contained in:
parent
bc1eff83cb
commit
71e653db30
|
@ -43,8 +43,13 @@ void queryDoNotDisturbState() {
|
||||||
}
|
}
|
||||||
LastSettingsQueryMs = ms;
|
LastSettingsQueryMs = ms;
|
||||||
|
|
||||||
id userDefaultsValue = [[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.notificationcenterui"] objectForKey:@"doNotDisturb"];
|
auto userDefaults = [NSUserDefaults alloc];
|
||||||
DoNotDisturbEnabled = [userDefaultsValue boolValue];
|
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;
|
using Manager = Platform::Notifications::Manager;
|
||||||
|
|
|
@ -60,7 +60,7 @@ void System::createManager() {
|
||||||
void System::schedule(History *history, HistoryItem *item) {
|
void System::schedule(History *history, HistoryItem *item) {
|
||||||
if (App::quitting() || !history->currentNotification() || !App::api()) return;
|
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()) {
|
if (item->isSilent()) {
|
||||||
history->popNotification(item);
|
history->popNotification(item);
|
||||||
|
|
Loading…
Reference in New Issue