Skip to content

Commit

Permalink
IMPROVED VERSION: Show media attachments in the "L" list of links
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Fidelman authored and ihabunek committed Nov 21, 2022
1 parent 12d6825 commit 0d20a48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toot/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ def show_status_source(self, status):

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),
Expand Down

0 comments on commit 0d20a48

Please sign in to comment.