From 6125918e90347c891db435842d7de66060a8fbf6 Mon Sep 17 00:00:00 2001
From: André Oliveira <37463445+SpecialAro@users.noreply.github.com>
Date: Thu, 8 Sep 2022 00:41:49 +0100
Subject: feat: add ability to set how ferdium handles webrtc ip when using a
 VPN (#602)

---
 src/containers/settings/EditSettingsScreen.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'src/containers/settings/EditSettingsScreen.tsx')

diff --git a/src/containers/settings/EditSettingsScreen.tsx b/src/containers/settings/EditSettingsScreen.tsx
index a4d7ba0eb..162d422ce 100644
--- a/src/containers/settings/EditSettingsScreen.tsx
+++ b/src/containers/settings/EditSettingsScreen.tsx
@@ -26,6 +26,7 @@ import {
   WAKE_UP_HIBERNATION_STRATEGIES,
   SPLIT_COLUMNS_MIN,
   SPLIT_COLUMNS_MAX,
+  WEBRTC_IP_HANDLING_POLICY,
 } from '../../config';
 import { isMac } from '../../environment';
 
@@ -103,6 +104,10 @@ const messages = defineMessages({
     id: 'settings.app.form.navigationBarBehaviour',
     defaultMessage: 'Navigation bar behaviour',
   },
+  webRTCIPHandlingPolicy: {
+    id: 'settings.app.form.webRTCIPHandlingPolicy',
+    defaultMessage: 'WebRTC IP Handling Policy',
+  },
   searchEngine: {
     id: 'settings.app.form.searchEngine',
     defaultMessage: 'Search engine',
@@ -357,6 +362,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> {
         clipboardNotifications: Boolean(settingsData.clipboardNotifications),
         notifyTaskBarOnMessage: Boolean(settingsData.notifyTaskBarOnMessage),
         navigationBarBehaviour: settingsData.navigationBarBehaviour,
+        webRTCIPHandlingPolicy: settingsData.webRTCIPHandlingPolicy,
         searchEngine: settingsData.searchEngine,
         translatorEngine: settingsData.translatorEngine,
         translatorLanguage: settingsData.translatorLanguage,
@@ -465,6 +471,11 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> {
       sort: false,
     });
 
+    const webRTCIPHandlingPolicies = getSelectOptions({
+      locales: WEBRTC_IP_HANDLING_POLICY,
+      sort: false,
+    });
+
     const searchEngines = getSelectOptions({
       locales: SEARCH_ENGINE_NAMES,
       sort: false,
@@ -597,6 +608,12 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> {
           default: DEFAULT_APP_SETTINGS.navigationBarBehaviour,
           options: navigationBarBehaviours,
         },
+        webRTCIPHandlingPolicy: {
+          label: intl.formatMessage(messages.webRTCIPHandlingPolicy),
+          value: settings.all.app.webRTCIPHandlingPolicy,
+          default: DEFAULT_APP_SETTINGS.webRTCIPHandlingPolicy,
+          options: webRTCIPHandlingPolicies,
+        },
         searchEngine: {
           label: intl.formatMessage(messages.searchEngine),
           value: settings.all.app.searchEngine,
-- 
cgit v1.2.3-70-g09d2

