mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-26 23:10:39 +00:00
More debug output
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
This commit is contained in:
parent
4950607cc1
commit
748cf3f512
@ -86,18 +86,24 @@ BOOL installNSBundleHook()
|
||||
^{
|
||||
int notificationId = [notification.userInfo[@"id"] intValue];
|
||||
qDebug() << "!!! Notification was delivered to NotificationCenter. ID:" << notificationId;
|
||||
BOOL notificationAvailable = YES;
|
||||
while(notificationAvailable) {
|
||||
notificationAvailable = NO;
|
||||
qDebug() << "--- List available notifications in NotificationCenter:";
|
||||
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
|
||||
int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue];
|
||||
qDebug() << "--- Notification is available with ID:" << fetchedNotificationID;
|
||||
}
|
||||
bool notificationAvailable = true;
|
||||
while(notificationAvailable == true) {
|
||||
notificationAvailable = false;
|
||||
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
|
||||
int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue];
|
||||
if(fetchedNotificationID == notificationId) {
|
||||
notificationAvailable = YES;
|
||||
notificationAvailable = true;
|
||||
[NSThread sleepForTimeInterval:0.25f];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << "Finishing availability checking for notificaion with ID:" <<notificationId;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (!m_IdToNotification.contains(notificationId)) {
|
||||
qCWarning(SNORE) << "Delivered notification is not recognized and will not be remove from active list. Notification id:" << notificationId;
|
||||
|
Loading…
x
Reference in New Issue
Block a user