diff --git a/TODO.md b/TODO.md index cf389c14..d2d68e07 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,7 @@ # TODO +- Fix right margin of own `\n` messages + - handle invalid access token - If an account is gone from the user's config, discard UI state last page - filter > enter > room list is always scrolled to top diff --git a/src/gui/Pages/Chat/Timeline/EventImage.qml b/src/gui/Pages/Chat/Timeline/EventImage.qml index 5942e02c..ee65338d 100644 --- a/src/gui/Pages/Chat/Timeline/EventImage.qml +++ b/src/gui/Pages/Chat/Timeline/EventImage.qml @@ -64,7 +64,7 @@ HMxcImage { clientUserId: chat.userId title: thumbnail ? loader.thumbnailTitle : loader.title - animated: eventList.isAnimated(loader.singleMediaInfo) + animated: eventList.isAnimated(loader.singleMediaInfo, loader.mediaUrl) thumbnail: ! animated && loader.thumbnailMxc mxc: thumbnail ? (loader.thumbnailMxc || loader.mediaUrl) : diff --git a/src/gui/Pages/Chat/Timeline/EventList.qml b/src/gui/Pages/Chat/Timeline/EventList.qml index 4daf727e..d362f40b 100644 --- a/src/gui/Pages/Chat/Timeline/EventList.qml +++ b/src/gui/Pages/Chat/Timeline/EventList.qml @@ -395,10 +395,13 @@ Rectangle { ) } - function isAnimated(event) { + function isAnimated(event, forLink="") { + const link = forLink || event.media_url + print(forLink, "-", link) + return ( event.media_mime === "image/gif" || - utils.urlExtension(event.media_url).toLowerCase() === "gif" + utils.urlExtension(link).toLowerCase() === "gif" ) } @@ -425,7 +428,7 @@ Rectangle { // The thumbnail/cached path will be the full GIF const fullMxc = - forLink || (isAnimated(event) ? "" : event.media_url) + forLink || (isAnimated(event, forLink) ? "" : event.media_url) window.makePopup( "Popups/ImageViewerPopup/ImageViewerPopup.qml",