From 274a58b789cc91f4940cacbe81dbbe5a09d8791e Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Thu, 12 Jul 2018 18:22:32 +0200 Subject: [PATCH] added user info to notfication --- MacPass/MPAutotypeDaemon.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MacPass/MPAutotypeDaemon.m b/MacPass/MPAutotypeDaemon.m index a82545bb..622f8d65 100644 --- a/MacPass/MPAutotypeDaemon.m +++ b/MacPass/MPAutotypeDaemon.m @@ -41,6 +41,9 @@ NSString *const kMPWindowTitleKey = @"kMPWindowTitleKey"; NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey"; +NSString *const kMPUserNotificationInfoKeyNotificationType = @"kMPUserNotificationInfoKeyNotificationType"; +NSString *const kMPUserNotificationTypeAutotype = @"kMPUserNotificationTypeAutotype"; + @interface MPAutotypeDaemon () @property (nonatomic, assign) BOOL enabled; @@ -194,6 +197,7 @@ static MPAutotypeDaemon *_sharedInstance; if(!entryOrNil) { NSUserNotification *notification = [[NSUserNotification alloc] init]; notification.title = NSApp.applicationName; + notification.userInfo = @{ kMPUserNotificationInfoKeyNotificationType: kMPUserNotificationTypeAutotype }; if(context) { notification.informativeText = [NSString stringWithFormat:NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH_FOR_%@", "Notification: Autotype found a single match for %@ (string placeholder)."), self.targetWindowTitle]; } @@ -313,7 +317,7 @@ static MPAutotypeDaemon *_sharedInstance; #pragma mark MPDocument Notifications - (void)_didUnlockDatabase:(NSNotification *)notification { /* Remove ourselves and call again to search matches */ - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [NSNotificationCenter.defaultCenter removeObserver:self name:MPDocumentDidUnlockDatabaseNotification object:nil]; [self _performAutotypeForEntry:nil]; }