forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatPrivacy.ts
More file actions
23 lines (21 loc) · 913 Bytes
/
Copy pathchatPrivacy.ts
File metadata and controls
23 lines (21 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// IPC for chat-privacy toggles that live in main's app settings.
//
// Currently just "Screen Sharing in Chat" (chatScreenshotSharingEnabled) — the
// consent gate the `capture_screen` tool reads at dispatch (captureScreenExecutor
// .ts). Mirrors the meeting:getSettings / meeting:setSettings shape: read/write a
// single persisted flag, returning the sanitized value so the renderer stays in
// sync with what was actually stored.
import { ipcMain } from 'electron'
import { getAppSettings, setAppSettings } from '../appSettings'
export function registerChatPrivacyHandlers(): void {
ipcMain.handle(
'chat:getScreenshotSharing',
async () => getAppSettings().chatScreenshotSharingEnabled
)
ipcMain.handle(
'chat:setScreenshotSharing',
async (_e, enabled: boolean) =>
setAppSettings({ chatScreenshotSharingEnabled: enabled === true })
.chatScreenshotSharingEnabled
)
}