From 755c66b9f19b51bd65d7289873553c387bc5ff5d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 22 May 2017 18:30:45 +0100 Subject: [PATCH] pass dispatcher through to electron, on a whitelist basis Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 5710e66e4a..ecbc5bd00a 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -54,7 +54,19 @@ function platformFriendlyName(): string { } } +function _onAction(payload: Object) { + // Whitelist payload actions, no point sending most across + if (['call_state'].includes(payload.action)) { + ipcRenderer.send('app_onAction', payload); + } +} + export default class ElectronPlatform extends VectorBasePlatform { + constructor() { + super(); + dis.register(_onAction); + } + setNotificationCount(count: number) { if (this.notificationCount === count) return; super.setNotificationCount(count);