mirror of https://github.com/vector-im/riot-web
Update MSC reference
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/28513/head
parent
ef1c7a1650
commit
5a09b081d7
|
@ -24,9 +24,9 @@ declare module "matrix-js-sdk/src/types" {
|
||||||
|
|
||||||
export interface ImageInfo {
|
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 {
|
export interface StateEvents {
|
||||||
|
|
|
@ -159,7 +159,7 @@ async function infoForImageFile(matrixClient: MatrixClient, roomId: string, imag
|
||||||
const result = await createThumbnail(imageElement.img, imageElement.width, imageElement.height, thumbnailType);
|
const result = await createThumbnail(imageElement.img, imageElement.width, imageElement.height, thumbnailType);
|
||||||
const imageInfo = result.info;
|
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
|
// For lesser supported image types, always include the thumbnail even if it is larger
|
||||||
if (!ALWAYS_INCLUDE_THUMBNAIL.includes(imageFile.type)) {
|
if (!ALWAYS_INCLUDE_THUMBNAIL.includes(imageFile.type)) {
|
||||||
|
|
|
@ -275,7 +275,7 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = this.props.mxEvent.getContent<ImageContent>();
|
const content = this.props.mxEvent.getContent<ImageContent>();
|
||||||
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
|
// 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.
|
// 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<IBodyProps, IState> {
|
||||||
try {
|
try {
|
||||||
const blob = await this.props.mediaEventHelper!.sourceBlob.value;
|
const blob = await this.props.mediaEventHelper!.sourceBlob.value;
|
||||||
if (
|
if (
|
||||||
content.info?.["org.matrix.mscXXXX.is_animated"] === false ||
|
content.info?.["org.matrix.msc4230.is_animated"] === false ||
|
||||||
!(await blobIsAnimated(content.info?.mimetype, blob))
|
!(await blobIsAnimated(content.info?.mimetype, blob))
|
||||||
) {
|
) {
|
||||||
isAnimated = false;
|
isAnimated = false;
|
||||||
|
|
Loading…
Reference in New Issue