Support Matrix 1.1 (drop legacy r0 versions) (#9819)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
f9e79fd5d6
commit
180fcaa70f
32 changed files with 712 additions and 440 deletions
|
@ -56,7 +56,7 @@ describe("<MImageBody/>", () => {
|
|||
},
|
||||
}),
|
||||
});
|
||||
const url = "https://server/_matrix/media/r0/download/server/encrypted-image";
|
||||
const url = "https://server/_matrix/media/v3/download/server/encrypted-image";
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
cli.mxcUrlToHttp.mockImplementation(
|
||||
(mxcUrl: string, width?: number, height?: number, resizeMethod?: string, allowDirectLinks?: boolean) => {
|
||||
|
@ -179,8 +179,8 @@ describe("<MImageBody/>", () => {
|
|||
});
|
||||
|
||||
it("should fall back to /download/ if /thumbnail/ fails", async () => {
|
||||
const thumbUrl = "https://server/_matrix/media/r0/thumbnail/server/image?width=800&height=600&method=scale";
|
||||
const downloadUrl = "https://server/_matrix/media/r0/download/server/image";
|
||||
const thumbUrl = "https://server/_matrix/media/v3/thumbnail/server/image?width=800&height=600&method=scale";
|
||||
const downloadUrl = "https://server/_matrix/media/v3/download/server/image";
|
||||
|
||||
const event = new MatrixEvent({
|
||||
room_id: "!room:server",
|
||||
|
@ -227,7 +227,7 @@ describe("<MImageBody/>", () => {
|
|||
mocked(global.URL.createObjectURL).mockReturnValue("blob:generated-thumb");
|
||||
|
||||
fetchMock.getOnce(
|
||||
"https://server/_matrix/media/r0/download/server/image",
|
||||
"https://server/_matrix/media/v3/download/server/image",
|
||||
{
|
||||
body: fs.readFileSync(path.resolve(__dirname, "..", "..", "..", "images", "animated-logo.webp")),
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@ describe("MVideoBody", () => {
|
|||
},
|
||||
}),
|
||||
});
|
||||
const thumbUrl = "https://server/_matrix/media/r0/download/server/encrypted-poster";
|
||||
const thumbUrl = "https://server/_matrix/media/v3/download/server/encrypted-poster";
|
||||
fetchMock.getOnce(thumbUrl, { status: 200 });
|
||||
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
|
|
|
@ -6,7 +6,7 @@ exports[`<MImageBody/> should generate a thumbnail if one isn't included for ani
|
|||
class="mx_MImageBody"
|
||||
>
|
||||
<a
|
||||
href="https://server/_matrix/media/r0/download/server/image"
|
||||
href="https://server/_matrix/media/v3/download/server/image"
|
||||
>
|
||||
<div
|
||||
class="mx_MImageBody_thumbnail_container"
|
||||
|
|
|
@ -37,7 +37,7 @@ exports[`MVideoBody should show poster for encrypted media before downloading it
|
|||
class="mx_MVideoBody"
|
||||
controls=""
|
||||
controlslist="nodownload"
|
||||
poster="https://server/_matrix/media/r0/download/server/encrypted-poster"
|
||||
poster="https://server/_matrix/media/v3/download/server/encrypted-poster"
|
||||
preload="none"
|
||||
title="alt for a test video"
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue