mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/timeline: prefer encrypted url if set
This commit is contained in:
parent
508f2252da
commit
cc4eb16c7c
1 changed files with 3 additions and 3 deletions
|
@ -23,9 +23,9 @@ import DownloadIcon from "@/icons/download.svg?react"
|
||||||
export const useMediaContent = (
|
export const useMediaContent = (
|
||||||
content: MediaMessageEventContent, evtType: EventType, containerSize?: ImageContainerSize,
|
content: MediaMessageEventContent, evtType: EventType, containerSize?: ImageContainerSize,
|
||||||
): [React.ReactElement | null, string, CSSProperties] => {
|
): [React.ReactElement | null, string, CSSProperties] => {
|
||||||
const mediaURL = content.url ? getMediaURL(content.url) : getEncryptedMediaURL(content.file?.url)
|
const mediaURL = content.file?.url ? getEncryptedMediaURL(content.file.url) : getMediaURL(content.url)
|
||||||
const thumbnailURL = content.info?.thumbnail_url
|
const thumbnailURL = content.info?.thumbnail_file?.url
|
||||||
? getMediaURL(content.info.thumbnail_url) : getEncryptedMediaURL(content.info?.thumbnail_file?.url)
|
? getEncryptedMediaURL(content.info.thumbnail_file.url) : getMediaURL(content.info?.thumbnail_url)
|
||||||
if (content.msgtype === "m.image" || evtType === "m.sticker") {
|
if (content.msgtype === "m.image" || evtType === "m.sticker") {
|
||||||
const style = calculateMediaSize(content.info?.w, content.info?.h, containerSize)
|
const style = calculateMediaSize(content.info?.w, content.info?.h, containerSize)
|
||||||
return [<img
|
return [<img
|
||||||
|
|
Loading…
Add table
Reference in a new issue