From 9acae28193d9ffb405f17876deb7f5595ed19749 Mon Sep 17 00:00:00 2001 From: blankie Date: Thu, 7 Dec 2023 09:44:41 +1100 Subject: [PATCH] Cap unknown media text size https://chaosfem.tw/@betsystreeter@mastodon.art/111456606953658581 --- routes/css.cpp | 5 +++++ servehelper.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/routes/css.cpp b/routes/css.cpp index 35e7a90..b9038c5 100644 --- a/routes/css.cpp +++ b/routes/css.cpp @@ -139,6 +139,11 @@ svg { .post-attachments audio { height: 40px; } +/* https://chaosfem.tw/@betsystreeter@mastodon.art/111456606953658581 */ +.post-attachments .unknown_media { + max-width: 320px; + max-height: 180px; +} /* POLL */ .poll-option { diff --git a/servehelper.cpp b/servehelper.cpp index 79fa956..3438686 100644 --- a/servehelper.cpp +++ b/servehelper.cpp @@ -544,9 +544,9 @@ static inline Element serialize_media(const Media& media) { } else if (media.type == "unknown") { if (media.remote_url) { // https://botsin.space/@lina@vt.social/111053598696451525 - return Element("a", {{"href", *media.remote_url}}, {"Media is not available from this instance, view externally"}); + return Element("a", {{"class", "unknown_media"}, {"href", *media.remote_url}}, {"Media is not available from this instance, view externally"}); } else { - return Element("p", {"Media is not available from this instance"}); + return Element("p", {{"class", "unknown_media"}}, {"Media is not available from this instance"}); } } else { return Element("p", {"Unsupported media type: ", media.type});