Skip to content

Commit

Permalink
Merge branch 'develop' into renovate/all-minor-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jun 28, 2023
2 parents a855370 + 0299aef commit 30c1de5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Update repo description
uses: peter-evans/dockerhub-description@579f64ca0abced29dbbc44ab4c6a0b9e33ab3588 # v3
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864 # v3
continue-on-error: true
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
10 changes: 7 additions & 3 deletions src/vector/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ function makeRegistrationUrl(params: QueryDict): string {

function onTokenLoginCompleted(): void {
// if we did a token login, we're now left with the token, hs and is
// url as query params in the url; a little nasty but let's redirect to
// clear them.
// url as query params in the url;
// if we did an oidc authorization code flow login, we're left with the auth code and state
// as query params in the url;
// a little nasty but let's redirect to clear them.
const url = new URL(window.location.href);

url.searchParams.delete("loginToken");
url.searchParams.delete("state");
url.searchParams.delete("code");

logger.log(`Redirecting to ${url.href} to drop loginToken from queryparams`);
logger.log(`Redirecting to ${url.href} to drop delegated authentication params from queryparams`);
window.history.replaceState(null, "", url.href);
}

Expand Down
43 changes: 37 additions & 6 deletions src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,40 @@ import type {
AudioMuteStatusChangedEvent,
LogEvent,
VideoMuteStatusChangedEvent,
ExternalAPIOptions as _ExternalAPIOptions,
Config as _Config,
InterfaceConfig as _InterfaceConfig,
} from "jitsi-meet";
import { getVectorConfig } from "../getconfig";

interface Config extends _Config {
// Jitsi's types are missing these fields
prejoinConfig?: {
enabled: boolean;
hideDisplayName?: boolean;
hideExtraJoinButtons?: string[];
};
toolbarButtons?: string[];
conferenceInfo?: {
alwaysVIsible?: string[];
autoHide?: string[];
};
disableSelfViewSettings?: boolean;
}

interface InterfaceConfig extends _InterfaceConfig {
// XXX: It is unclear whether this is a typo of TOOLBAR_BUTTONS or if its just really undocumented,
// either way it is missing in types, yet we try and use it
MAIN_TOOLBAR_BUTTONS?: string[];
}

interface ExternalAPIOptions extends _ExternalAPIOptions {
configOverwrite?: Config;
interfaceConfigOverwrite?: InterfaceConfig;
// Jitsi's types are missing these fields
lang?: string;
}

// We have to trick webpack into loading our CSS for us.
require("./index.pcss");

Expand Down Expand Up @@ -382,7 +413,7 @@ async function joinConference(audioInput?: string | null, videoInput?: string |
"our fragment values and not recognizing the options.",
);

const options = {
const options: ExternalAPIOptions = {
width: "100%",
height: "100%",
parentNode: document.querySelector("#jitsiContainer") ?? undefined,
Expand Down Expand Up @@ -421,20 +452,20 @@ async function joinConference(audioInput?: string | null, videoInput?: string |
if (isVideoChannel) {
// Ensure that we skip Jitsi Meet's native prejoin screen, for
// deployments that have it enabled
options.configOverwrite.prejoinConfig = { enabled: false };
options.configOverwrite!.prejoinConfig = { enabled: false };
// Use a simplified set of toolbar buttons
options.configOverwrite.toolbarButtons = ["microphone", "camera", "tileview", "hangup"];
options.configOverwrite!.toolbarButtons = ["microphone", "camera", "tileview", "hangup"];
// Note: We can hide the screenshare button in video rooms but not in
// normal conference calls, since in video rooms we control exactly what
// set of controls appear, but in normal calls we need to leave that up
// to the deployment's configuration.
// https://github.com/vector-im/element-web/issues/4880#issuecomment-940002464
if (supportsScreensharing) options.configOverwrite.toolbarButtons.splice(2, 0, "desktop");
if (supportsScreensharing) options.configOverwrite!.toolbarButtons.splice(2, 0, "desktop");
// Hide all top bar elements
options.configOverwrite.conferenceInfo = { autoHide: [] };
options.configOverwrite!.conferenceInfo = { autoHide: [] };
// Remove the ability to hide your own tile, since we're hiding the
// settings button which would be the only way to get it back
options.configOverwrite.disableSelfViewSettings = true;
options.configOverwrite!.disableSelfViewSettings = true;
}

meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
Expand Down
4 changes: 2 additions & 2 deletions test/app-tests/loading-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ describe("loading:", function () {
httpBackend.verifyNoOutstandingExpectation();
expect(matrixChat?.container.querySelector(".mx_Welcome")).toBeTruthy();
expect(windowLocation?.hash).toEqual("#/welcome");
expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL);
expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL);
expect(MatrixClientPeg.safeGet().baseUrl).toEqual(DEFAULT_HS_URL);
expect(MatrixClientPeg.safeGet().idBaseUrl).toEqual(DEFAULT_IS_URL);
});
});

Expand Down

0 comments on commit 30c1de5

Please sign in to comment.