mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-22 21:23:09 +01:00
add canonical alias or roomId util
This commit is contained in:
parent
c10e42e999
commit
f81e6616b0
1 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,9 @@ export const parseMatrixToUrl = (url: string): [string | undefined, string | und
|
|||
export const getCanonicalAliasRoomId = (mx: MatrixClient, alias: string): string | undefined =>
|
||||
mx.getRooms()?.find((room) => room.getCanonicalAlias() === alias)?.roomId;
|
||||
|
||||
export const getCanonicalAliasOrRoomId = (mx: MatrixClient, roomId: string): string =>
|
||||
mx.getRoom(roomId)?.getCanonicalAlias() || roomId;
|
||||
|
||||
export const getImageInfo = (img: HTMLImageElement, fileOrBlob: File | Blob): IImageInfo => {
|
||||
const info: IImageInfo = {};
|
||||
info.w = img.width;
|
||||
|
|
Loading…
Reference in a new issue