diff --git a/TODO.md b/TODO.md index fc644007..9e474ba5 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,7 @@ # TODO - strip file:// from copy path +- some way to show name and date on EventFile - sentinel func to report path if already cached without having to click - verify eventfile height diff --git a/src/qml/Chat/Timeline/EventMediaLoader.qml b/src/qml/Chat/Timeline/EventMediaLoader.qml index d54e6858..6e83cc31 100644 --- a/src/qml/Chat/Timeline/EventMediaLoader.qml +++ b/src/qml/Chat/Timeline/EventMediaLoader.qml @@ -10,7 +10,7 @@ HLoader { if (type === EventDelegate.Media.Image) { var file = "EventImage.qml" - } else if (type === EventDelegate.Media.File) { + } else if (type !== EventDelegate.Media.Page) { var file = "EventFile.qml" } else { return } @@ -71,6 +71,11 @@ HLoader { function download(callback) { + if (! loader.mediaUrl.startsWith("mxc://")) { + downloadedPath = loader.mediaUrl + callback(loader.mediaUrl) + } + if (! downloadedPath) print("Downloading " + loader.mediaUrl + " ...") const args = [loader.mediaUrl, loader.singleMediaInfo.media_crypt_dict]