diff --git a/TelegramTest/AppDelegate.m b/TelegramTest/AppDelegate.m index a158a2be..ab2ede48 100644 --- a/TelegramTest/AppDelegate.m +++ b/TelegramTest/AppDelegate.m @@ -245,13 +245,15 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNot ELog(@"nil dialog here, check it"); return; } - - [self.mainWindow deminiaturize:self]; + [self.mainWindow.navigationController showMessagesViewController:dialog]; - - if (floor(NSAppKitVersionNumber) > 1187 && notification.activationType == 3) { //NSUserNotificationActivationTypeReplied) + if (notification.activationType != 3) { + // only deminiaturize the window if user clicked the notification itself + // and not replied + [self.mainWindow deminiaturize:self]; + } else if (floor(NSAppKitVersionNumber) > 1187 && notification.activationType == 3) { //NSUserNotificationActivationTypeReplied) NSString *userResponse = notification.response.string; dispatch_async(dispatch_get_main_queue(), ^{ @@ -273,9 +275,6 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNot return; } - - - } -(void)didStatusItemClicked {