Skip to content

Commit 583ac3d

Browse files
authored
Jitsi requests 'requires_client' capability if auth token is provided (#24294)
* Jitsi requests 'io.element.requires_client' capability if auth token is provided * Added a comment that Jitsi should request 'requires_client' capability to hide the popup icon in the Element if auth token is provided. --------- Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
1 parent 50f2b53 commit 583ac3d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/vector/jitsi/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { ElementWidgetActions } from "matrix-react-sdk/src/stores/widgets/Elemen
2828
import { logger } from "matrix-js-sdk/src/logger";
2929
import { IConfigOptions } from "matrix-react-sdk/src/IConfigOptions";
3030
import { SnakedObject } from "matrix-react-sdk/src/utils/SnakedObject";
31+
import { ElementWidgetCapabilities } from "matrix-react-sdk/src/stores/widgets/ElementWidgetCapabilities";
3132

3233
import { getVectorConfig } from "../getconfig";
3334

@@ -98,6 +99,13 @@ const setupCompleted = (async (): Promise<string | void> => {
9899

99100
widgetApiReady = new Promise<void>((resolve) => widgetApi.once("ready", resolve));
100101
widgetApi.requestCapabilities(VideoConferenceCapabilities);
102+
103+
// jitsi cannot work in a popup if auth token is provided because widgetApi is not available there
104+
// so check the token and request the 'requires_client' capability to hide the popup icon in the Element
105+
if (qsParam("auth", true) === "openidtoken-jwt") {
106+
widgetApi.requestCapability(ElementWidgetCapabilities.RequiresClient);
107+
}
108+
101109
widgetApi.start();
102110

103111
const handleAction = (

0 commit comments

Comments
 (0)