From 0d20a4878bf587e4c8785b8305517f77781ee604 Mon Sep 17 00:00:00 2001 From: Peter Fidelman Date: Wed, 13 Apr 2022 21:33:58 -0700 Subject: [PATCH] IMPROVED VERSION: Show media attachments in the "L" list of links --- toot/tui/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toot/tui/app.py b/toot/tui/app.py index 2fe0b22..d518e0a 100644 --- a/toot/tui/app.py +++ b/toot/tui/app.py @@ -325,6 +325,11 @@ class TUI(urwid.Frame): def show_links(self, status): links = parse_content_links(status.data["content"]) if status else [] + post_attachments = status.data["media_attachments"] or [] + reblog_attachments = (status.data["reblog"]["media_attachments"] if status.data["reblog"] else None) or [] + for a in post_attachments + reblog_attachments: + url = a["remote_url"] or a["url"] + links.append((url, a["description"] if a["description"] else url)) if links: self.open_overlay( widget=StatusLinks(links),