From b79bcf7da6154b4b03fea9fcb07039fb684e115a Mon Sep 17 00:00:00 2001
From: Patrick Wardle <code@objective-see.com>
Date: Mon, 21 Nov 2022 19:51:13 -1000
Subject: [PATCH] Update AVMonitor.m

launch system prefs (via alert) if OverSight needs notifications
---
 Application/Application/AVMonitor.m | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Application/Application/AVMonitor.m b/Application/Application/AVMonitor.m
index 2fdc5d5..c188755 100644
--- a/Application/Application/AVMonitor.m
+++ b/Application/Application/AVMonitor.m
@@ -80,6 +80,9 @@ extern os_log_t logHandle;
                 {
                     //show alert
                     showAlert(@"ERROR: OverSight not authorized to display notifications!", @"Please authorize via the \"Notifications\" pane (in System Preferences).");
+                    
+                    //open `System Preferences` notifications pane
+                    [NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.notifications"]];
                 }
                 //bg thread
                 // show alert on main thread
@@ -90,6 +93,10 @@ extern os_log_t logHandle;
                     ^{
                         //show alert
                         showAlert(@"ERROR: OverSight not authorized to display notifications!", @"Please authorize via the \"Notifications\" pane (in System Preferences).");
+                        
+                        //open `System Preferences` notifications pane
+                        [NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.notifications"]];
+                        
                     });
                 }
             }