Use thumbnails instead of mxc download

This commit is contained in:
Jorik Schellekens
2020-09-23 15:30:46 +01:00
parent dd372dbb50
commit ee8c860507
7 changed files with 107 additions and 29 deletions
+19
View File
@@ -30,6 +30,7 @@ import {
getUserDetails,
convertMXCtoMediaQuery,
getGroupDetails,
getThumbnailURI as cypherGetThumbnailURI,
} from '../matrix-cypher';
import { LinkKind, Permalink } from '../parser/types';
@@ -177,6 +178,24 @@ export function getMediaQueryFromMCX(mxc?: string): string {
}
}
export function getThumbnailURI(
clientURL: string,
height: number,
width: number,
mxcId?: string,
): string {
if (!mxcId) {
return '';
}
try {
return cypherGetThumbnailURI(clientURL, mxcId, height, width);
} catch (e){
console.error(e);
return '';
}
}
export async function getGroup(
clientURL: string,
groupId: string