1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-16 06:15:25 +00:00

Try to use media's text_url if present

This field is sometimes provides and gives a shortened URL which is
easier to click on in a terminal.
This commit is contained in:
Denis Laxalde 2019-09-13 12:43:37 +02:00 committed by Ivan Habunek
parent a8774fc9ea
commit 9fb52fb0a1

View File

@ -238,7 +238,8 @@ class StatusDetails(urwid.Pile):
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: