From 867fc30ebfa2757365cb8cc0b575d9bd9943507e Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 10 Jun 2022 12:21:49 -0400 Subject: [PATCH] Work around a Jitsi bug with display name encoding (#22525) --- src/vector/jitsi/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 9270638b7b..734f6a82ba 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -394,6 +394,16 @@ function joinConference(audioDevice?: string, videoDevice?: string) { // fires once when user joins the conference // (regardless of video on or off) meetApi.on("videoConferenceJoined", () => { + // Although we set our displayName with the userInfo option above, that + // option has a bug where it causes the name to be the HTML encoding of + // what was actually intended. So, we use the displayName command to at + // least ensure that the name is correct after entering the meeting. + // https://github.com/jitsi/jitsi-meet/issues/11664 + // We can't just use these commands immediately after creating the + // iframe, because there's *another* bug where they can crash Jitsi by + // racing with its startup process. + if (displayName) meetApi.executeCommand("displayName", displayName); + // This doesn't have a userInfo equivalent, so has to be set via commands if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl); if (widgetApi) {