From 87e16f694a93b0234aa200ad9c4705e2ed9f0837 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:50:04 +0200 Subject: [PATCH 1/2] Also check the unstable feature for MSC3916 --- src/serviceworker/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serviceworker/index.ts b/src/serviceworker/index.ts index fc3e04fd514..3e064971c74 100644 --- a/src/serviceworker/index.ts +++ b/src/serviceworker/index.ts @@ -105,7 +105,7 @@ async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: str console.log(`[ServiceWorker] /versions response for '${clientApiUrl}': ${JSON.stringify(versions)}`); serverSupportMap[clientApiUrl] = { - supportsAuthedMedia: Boolean(versions?.versions?.includes("v1.11")), + supportsAuthedMedia: Boolean(versions?.versions?.includes("v1.11") || versions?.unstable_features?.["org.matrix.msc3916.stable"] === true), cacheExpiryTimeMs: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now }; console.log( From 8af94702480498a5ffbab8dcb8c716d7a2c59fcc Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:58:09 +0200 Subject: [PATCH 2/2] Make eslint happy --- src/serviceworker/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serviceworker/index.ts b/src/serviceworker/index.ts index 3e064971c74..23e2b6cf260 100644 --- a/src/serviceworker/index.ts +++ b/src/serviceworker/index.ts @@ -105,7 +105,10 @@ async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: str console.log(`[ServiceWorker] /versions response for '${clientApiUrl}': ${JSON.stringify(versions)}`); serverSupportMap[clientApiUrl] = { - supportsAuthedMedia: Boolean(versions?.versions?.includes("v1.11") || versions?.unstable_features?.["org.matrix.msc3916.stable"] === true), + supportsAuthedMedia: Boolean( + versions?.versions?.includes("v1.11") || + versions?.unstable_features?.["org.matrix.msc3916.stable"] === true, + ), cacheExpiryTimeMs: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now }; console.log(