Security: Clear clipboard if it was empty before dictation

- If clipboard was empty, clear it after paste (don't leave transcript)
- If clipboard had content, restore original content
- Prevents sensitive dictated text from remaining on clipboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hariel1985
2026-02-03 11:14:29 +01:00
szülő 47c7d2274a
commit 62cc705ce8

Fájl megtekintése

@@ -867,9 +867,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, URLSessionDownloadDelegate {
keyUp?.post(tap: .cghidEventTap) keyUp?.post(tap: .cghidEventTap)
// Restore original clipboard after a short delay // Restore original clipboard after a short delay
// If clipboard was empty, clear it (don't leave transcript)
// If clipboard had content, restore it
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
if savedItems.isEmpty {
NSPasteboard.general.clearContents()
} else {
self.restoreClipboard(savedItems) self.restoreClipboard(savedItems)
} }
}
self.statusItem.button?.title = "🎤" self.statusItem.button?.title = "🎤"
self.updateStatus("Ready") self.updateStatus("Ready")