IMPROVED VERSION: Show media attachments in the "L" list of links

This commit is contained in:
Peter Fidelman 2022-04-13 21:33:58 -07:00 committed by Ivan Habunek
parent 12d682591b
commit 0d20a4878b
1 changed files with 5 additions and 0 deletions

View File

@ -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),