mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-27 07:20:26 +00:00
Compare id from user info
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
This commit is contained in:
parent
a0a62a7f14
commit
8656195205
@ -89,7 +89,8 @@ BOOL installNSBundleHook()
|
|||||||
while(notificationAvailable) {
|
while(notificationAvailable) {
|
||||||
notificationAvailable = NO;
|
notificationAvailable = NO;
|
||||||
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
|
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
|
||||||
if([osxNotification.identifier isEqualToString:notification.identifier]) {
|
int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue];
|
||||||
|
if(fetchedNotificationID == notificationId) {
|
||||||
notificationAvailable = YES;
|
notificationAvailable = YES;
|
||||||
[NSThread sleepForTimeInterval:0.25f];
|
[NSThread sleepForTimeInterval:0.25f];
|
||||||
break;
|
break;
|
||||||
@ -155,7 +156,7 @@ void OSXNotificationCenter::slotNotify(Snore::Notification notification)
|
|||||||
osxNotification.title = notification.title().toNSString();
|
osxNotification.title = notification.title().toNSString();
|
||||||
osxNotification.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:notificationId, @"id", nil];
|
osxNotification.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:notificationId, @"id", nil];
|
||||||
osxNotification.informativeText = notification.text().toNSString();
|
osxNotification.informativeText = notification.text().toNSString();
|
||||||
osxNotification.identifier = notificationId;
|
//osxNotification.identifier = notificationId;
|
||||||
|
|
||||||
// Add notification to mapper from id to Nofification / NSUserNotification
|
// Add notification to mapper from id to Nofification / NSUserNotification
|
||||||
m_IdToNotification.insert(notification.id(), notification);
|
m_IdToNotification.insert(notification.id(), notification);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user