diff --git a/src/main/windows/callsWidgetWindow.test.js b/src/main/windows/callsWidgetWindow.test.js index 86bb2288..66608d3b 100644 --- a/src/main/windows/callsWidgetWindow.test.js +++ b/src/main/windows/callsWidgetWindow.test.js @@ -384,6 +384,16 @@ describe('main/windows/callsWidgetWindow', () => { expect(widgetWindow.getWidgetURL()).toBe(expected); }); + it('getWidgetURL - with rootID', () => { + const config = { + ...widgetConfig, + rootID: 'call_thread_id', + }; + const widgetWindow = new CallsWidgetWindow(mainWindow, mainView, config); + const expected = `${mainView.serverInfo.server.url}plugins/${CALLS_PLUGIN_ID}/standalone/widget.html?call_id=${config.callID}&root_id=call_thread_id`; + expect(widgetWindow.getWidgetURL()).toBe(expected); + }); + it('onShareScreen', () => { baseWindow.webContents = { ...baseWindow.webContents, diff --git a/src/main/windows/callsWidgetWindow.ts b/src/main/windows/callsWidgetWindow.ts index 822bc5aa..ecb2a196 100644 --- a/src/main/windows/callsWidgetWindow.ts +++ b/src/main/windows/callsWidgetWindow.ts @@ -146,6 +146,9 @@ export default class CallsWidgetWindow extends EventEmitter { if (this.config.title) { u.searchParams.append('title', this.config.title); } + if (this.config.rootID) { + u.searchParams.append('root_id', this.config.rootID); + } return u.toString(); } diff --git a/src/main/windows/windowManager.ts b/src/main/windows/windowManager.ts index 27ed4d4d..5195703f 100644 --- a/src/main/windows/windowManager.ts +++ b/src/main/windows/windowManager.ts @@ -148,6 +148,7 @@ export class WindowManager { this.callsWidgetWindow = new CallsWidgetWindow(this.mainWindow!, currentView, { callID: msg.callID, title: msg.title, + rootID: msg.rootID, channelURL: msg.channelURL, }); diff --git a/src/types/calls.ts b/src/types/calls.ts index 4de7986a..f8b598da 100644 --- a/src/types/calls.ts +++ b/src/types/calls.ts @@ -3,14 +3,11 @@ export type CallsWidgetWindowConfig = { callID: string; title: string; + rootID: string; channelURL: string; } -export type CallsJoinCallMessage = { - callID: string; - title: string; - channelURL: string; -} +export type CallsJoinCallMessage = CallsWidgetWindowConfig; export type CallsWidgetResizeMessage = { element: string;