From bca2e73f06fa49903e118c71e40098a18501268c Mon Sep 17 00:00:00 2001 From: Mikhail Aheichyk Date: Mon, 23 Jan 2023 17:02:17 +0300 Subject: [PATCH 1/2] Jitsi requests 'io.element.requires_client' capability if auth token is provided --- src/vector/jitsi/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 95d3301113c..1ec0e2141f5 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -28,6 +28,7 @@ import { ElementWidgetActions } from "matrix-react-sdk/src/stores/widgets/Elemen import { logger } from "matrix-js-sdk/src/logger"; import { IConfigOptions } from "matrix-react-sdk/src/IConfigOptions"; import { SnakedObject } from "matrix-react-sdk/src/utils/SnakedObject"; +import { ElementWidgetCapabilities } from "matrix-react-sdk/src/stores/widgets/ElementWidgetCapabilities"; import { getVectorConfig } from "../getconfig"; @@ -98,6 +99,10 @@ const setupCompleted = (async (): Promise => { widgetApiReady = new Promise((resolve) => widgetApi.once("ready", resolve)); widgetApi.requestCapabilities(VideoConferenceCapabilities); + if (qsParam("auth", true) === "openidtoken-jwt") { + widgetApi.requestCapability(ElementWidgetCapabilities.RequiresClient); + } + widgetApi.start(); const handleAction = ( From 54d8d153b912d939f63e01d942615c9f403c6cdd Mon Sep 17 00:00:00 2001 From: Mikhail Aheichyk Date: Wed, 25 Jan 2023 18:36:14 +0300 Subject: [PATCH 2/2] Added a comment that Jitsi should request 'requires_client' capability to hide the popup icon in the Element if auth token is provided. --- src/vector/jitsi/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 1ec0e2141f5..e06073f1d22 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -99,6 +99,9 @@ const setupCompleted = (async (): Promise => { widgetApiReady = new Promise((resolve) => widgetApi.once("ready", resolve)); widgetApi.requestCapabilities(VideoConferenceCapabilities); + + // jitsi cannot work in a popup if auth token is provided because widgetApi is not available there + // so check the token and request the 'requires_client' capability to hide the popup icon in the Element if (qsParam("auth", true) === "openidtoken-jwt") { widgetApi.requestCapability(ElementWidgetCapabilities.RequiresClient); }