diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-01-03 03:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 03:46:28 +0100 |
commit | b0b9860f68b0a151841d0c145a11ea39c11fa66a (patch) | |
tree | dda676c476500bd08622ca0dc831f6f1da915bcb /src/webview | |
parent | 6.7.1-nightly.2 [skip ci] (diff) | |
download | ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.tar.gz ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.tar.zst ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.zip |
Rudimentary DBus toggle-to-talk support (#1507)
Adds a ToggleToTalk method to the DBus interface to unmute/mute the
microphone in the active service if the recipe supports it.
We will need to add support for this feature in recipes.
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/lib/RecipeWebview.ts | 6 | ||||
-rw-r--r-- | src/webview/recipe.ts | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts index 44b3c5ab4..31e9a288d 100644 --- a/src/webview/lib/RecipeWebview.ts +++ b/src/webview/lib/RecipeWebview.ts | |||
@@ -40,6 +40,8 @@ class RecipeWebview { | |||
40 | 40 | ||
41 | loopFunc = () => null; | 41 | loopFunc = () => null; |
42 | 42 | ||
43 | toggleToTalkFunc = () => null; | ||
44 | |||
43 | darkModeHandler: ((darkMode: boolean, config: any) => void) | null = null; | 45 | darkModeHandler: ((darkMode: boolean, config: any) => void) | null = null; |
44 | 46 | ||
45 | // TODO Remove this once we implement a proper wrapper. | 47 | // TODO Remove this once we implement a proper wrapper. |
@@ -199,6 +201,10 @@ class RecipeWebview { | |||
199 | openNewWindow(url) { | 201 | openNewWindow(url) { |
200 | ipcRenderer.sendToHost('new-window', url); | 202 | ipcRenderer.sendToHost('new-window', url); |
201 | } | 203 | } |
204 | |||
205 | toggleToTalk(fn) { | ||
206 | this.toggleToTalkFunc = fn; | ||
207 | } | ||
202 | } | 208 | } |
203 | 209 | ||
204 | export default RecipeWebview; | 210 | export default RecipeWebview; |
diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index b394f1517..f2a13f224 100644 --- a/src/webview/recipe.ts +++ b/src/webview/recipe.ts | |||
@@ -158,6 +158,7 @@ class RecipeController { | |||
158 | 'service-settings-update': 'updateServiceSettings', | 158 | 'service-settings-update': 'updateServiceSettings', |
159 | 'get-service-id': 'serviceIdEcho', | 159 | 'get-service-id': 'serviceIdEcho', |
160 | 'find-in-page': 'openFindInPage', | 160 | 'find-in-page': 'openFindInPage', |
161 | 'toggle-to-talk': 'toggleToTalk', | ||
161 | }; | 162 | }; |
162 | 163 | ||
163 | universalDarkModeInjected = false; | 164 | universalDarkModeInjected = false; |
@@ -483,6 +484,10 @@ class RecipeController { | |||
483 | }, 225), | 484 | }, 225), |
484 | ); | 485 | ); |
485 | } | 486 | } |
487 | |||
488 | toggleToTalk() { | ||
489 | this.recipe?.toggleToTalkFunc?.(); | ||
490 | } | ||
486 | } | 491 | } |
487 | 492 | ||
488 | /* eslint-disable no-new */ | 493 | /* eslint-disable no-new */ |