Skip to content

Commit

Permalink
Try to use media's text_url if present
Browse files Browse the repository at this point in the history
This field is sometimes provides and gives a shortened URL which is
easier to click on in a terminal.
  • Loading branch information
Denis Laxalde authored and ihabunek committed Sep 13, 2019
1 parent a8774fc commit 9fb52fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion toot/tui/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def content_generator(self, status):
yield ("pack", urwid.Text([("bold", "Media attachment"), " (", m["type"], ")"]))
if m["description"]:
yield ("pack", urwid.Text(m["description"]))
yield ("pack", urwid.Text(("link", m["url"])))
url = m.get("text_url") or m["url"]
yield ("pack", urwid.Text(("link", url)))

poll = status.data.get("poll")
if poll:
Expand Down

0 comments on commit 9fb52fb

Please sign in to comment.