From 5a09b081d77a4133813fbcd3bbfc8ca6bc18af29 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 21 Nov 2024 12:53:34 +0000 Subject: [PATCH] Update MSC reference Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/@types/matrix-js-sdk.d.ts | 4 ++-- src/ContentMessages.ts | 2 +- src/components/views/messages/MImageBody.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/@types/matrix-js-sdk.d.ts b/src/@types/matrix-js-sdk.d.ts index babe491aca..73366f2fee 100644 --- a/src/@types/matrix-js-sdk.d.ts +++ b/src/@types/matrix-js-sdk.d.ts @@ -24,9 +24,9 @@ declare module "matrix-js-sdk/src/types" { export interface ImageInfo { /** - * @see https://github.com/matrix-org/matrix-spec-proposals/pull/XXXX + * @see https://github.com/matrix-org/matrix-spec-proposals/pull/4230 */ - "org.matrix.mscXXXX.is_animated"?: boolean; + "org.matrix.msc4230.is_animated"?: boolean; } export interface StateEvents { diff --git a/src/ContentMessages.ts b/src/ContentMessages.ts index 53d6011269..344a2f112c 100644 --- a/src/ContentMessages.ts +++ b/src/ContentMessages.ts @@ -159,7 +159,7 @@ async function infoForImageFile(matrixClient: MatrixClient, roomId: string, imag const result = await createThumbnail(imageElement.img, imageElement.width, imageElement.height, thumbnailType); const imageInfo = result.info; - imageInfo["org.matrix.mscXXXX.is_animated"] = await isAnimatedPromise; + imageInfo["org.matrix.msc4230.is_animated"] = await isAnimatedPromise; // For lesser supported image types, always include the thumbnail even if it is larger if (!ALWAYS_INCLUDE_THUMBNAIL.includes(imageFile.type)) { diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 1605766f28..41cefb68bb 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -275,7 +275,7 @@ export default class MImageBody extends React.Component { } const content = this.props.mxEvent.getContent(); - let isAnimated = content.info?.["org.matrix.mscXXXX.is_animated"] ?? mayBeAnimated(content.info?.mimetype); + let isAnimated = content.info?.["org.matrix.msc4230.is_animated"] ?? mayBeAnimated(content.info?.mimetype); // If there is no included non-animated thumbnail then we will generate our own, we can't depend on the server // because 1. encryption and 2. we can't ask the server specifically for a non-animated thumbnail. @@ -300,7 +300,7 @@ export default class MImageBody extends React.Component { try { const blob = await this.props.mediaEventHelper!.sourceBlob.value; if ( - content.info?.["org.matrix.mscXXXX.is_animated"] === false || + content.info?.["org.matrix.msc4230.is_animated"] === false || !(await blobIsAnimated(content.info?.mimetype, blob)) ) { isAnimated = false;