mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Add screensharing behind a feature flag
This commit is contained in:
committed by
Scott Nonnenberg
parent
7c7f7ee5a0
commit
ceffc2380c
+23
-12
@@ -23,18 +23,29 @@ function _createPermissionHandler(userConfig) {
|
||||
return (webContents, permission, callback, details) => {
|
||||
// We default 'media' permission to false, but the user can override that for
|
||||
// the microphone and camera.
|
||||
if (
|
||||
permission === 'media' &&
|
||||
details.mediaTypes.includes('audio') &&
|
||||
userConfig.get('mediaPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
if (
|
||||
permission === 'media' &&
|
||||
details.mediaTypes.includes('video') &&
|
||||
userConfig.get('mediaCameraPermissions')
|
||||
) {
|
||||
if (permission === 'media') {
|
||||
if (
|
||||
details.mediaTypes.includes('audio') ||
|
||||
details.mediaTypes.includes('video')
|
||||
) {
|
||||
if (
|
||||
details.mediaTypes.includes('audio') &&
|
||||
userConfig.get('mediaPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
if (
|
||||
details.mediaTypes.includes('video') &&
|
||||
userConfig.get('mediaCameraPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
|
||||
return callback(false);
|
||||
}
|
||||
|
||||
// If it doesn't have 'video' or 'audio', it's probably screenshare.
|
||||
// TODO: DESKTOP-1611
|
||||
return callback(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user