Skip to content

Commit

Permalink
Jitsi requests 'requires_client' capability if auth token is provided (
Browse files Browse the repository at this point in the history
…#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>
  • Loading branch information
maheichyk and Mikhail Aheichyk authored Jan 31, 2023
1 parent 50f2b53 commit 583ac3d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

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

widgetApiReady = new Promise<void>((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);
}

widgetApi.start();

const handleAction = (
Expand Down

0 comments on commit 583ac3d

Please sign in to comment.