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
2 changed files with 5 additions and 2 deletions
|
@ -31,6 +31,9 @@ class Status:
|
||||||
self.reblogged = data.get("reblogged", False)
|
self.reblogged = data.get("reblogged", False)
|
||||||
self.in_reply_to = data.get("in_reply_to_id")
|
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):
|
def get_author(self):
|
||||||
# Show the author, not the persopn who reblogged
|
# Show the author, not the persopn who reblogged
|
||||||
data = self.data["reblog"] or self.data
|
data = self.data["reblog"] or self.data
|
||||||
|
|
|
@ -149,8 +149,8 @@ class Timeline(urwid.Columns):
|
||||||
return
|
return
|
||||||
|
|
||||||
if key in ("v", "V"):
|
if key in ("v", "V"):
|
||||||
if status.data["url"]:
|
if status.url:
|
||||||
webbrowser.open(status.data["url"])
|
webbrowser.open(status.url)
|
||||||
return
|
return
|
||||||
|
|
||||||
return super().keypress(size, key)
|
return super().keypress(size, key)
|
||||||
|
|
Loading…
Reference in a new issue