mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
Add tests for alive queries
This commit is contained in:
@@ -489,10 +489,12 @@ live_delivered_notifications(void) {
|
||||
UNUserNotificationCenter *center = get_notification_center_safely();
|
||||
if (!center) return false;
|
||||
[center getDeliveredNotificationsWithCompletionHandler:^(NSArray<UNNotification *> * notifications) {
|
||||
NSMutableString *buffer = [[NSMutableString stringWithCapacity:1024] autorelease];
|
||||
for (UNNotification *n in notifications) [buffer appendFormat:@"%@,", [[n request] identifier]];
|
||||
const char *val = [buffer UTF8String];
|
||||
set_cocoa_pending_action(COCOA_NOTIFICATION_UNTRACKED, val ? val : "");
|
||||
@autoreleasepool {
|
||||
NSMutableString *buffer = [NSMutableString stringWithCapacity:1024]; // autoreleased
|
||||
for (UNNotification *n in notifications) [buffer appendFormat:@"%@,", [[n request] identifier]];
|
||||
const char *val = [buffer UTF8String];
|
||||
set_cocoa_pending_action(COCOA_NOTIFICATION_UNTRACKED, val ? val : "");
|
||||
}
|
||||
}];
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user