mirror of
https://github.com/ihabunek/toot
synced 2024-12-23 07:27:12 +01:00
Make "view" action work for reblogged statuses
When the status is a reblog, the URL of the original toot should be used as the one of reblog is null. We add a "url" attribute to Status class storing computed URL.
This commit is contained in:
parent
3a56243878
commit
9d0d1b2dd7
@ -31,6 +31,9 @@ class Status:
|
||||
self.reblogged = data.get("reblogged", False)
|
||||
self.in_reply_to = data.get("in_reply_to_id")
|
||||
|
||||
reblog = data.get("reblog")
|
||||
self.url = reblog.get("url") if reblog else data.get("url")
|
||||
|
||||
def get_author(self):
|
||||
# Show the author, not the persopn who reblogged
|
||||
data = self.data["reblog"] or self.data
|
||||
|
@ -149,8 +149,8 @@ class Timeline(urwid.Columns):
|
||||
return
|
||||
|
||||
if key in ("v", "V"):
|
||||
if status.data["url"]:
|
||||
webbrowser.open(status.data["url"])
|
||||
if status.url:
|
||||
webbrowser.open(status.url)
|
||||
return
|
||||
|
||||
return super().keypress(size, key)
|
||||
|
Loading…
Reference in New Issue
Block a user