Skip to content

Commit

Permalink
Indicate if status is a reblog in timeline
Browse files Browse the repository at this point in the history
This is different from the "reblogged" yellow icon already displayed on
the left of account name which indicates if own status got reblogged.
This one indicates if displayed status is a reblog.
  • Loading branch information
dlax authored and ihabunek committed Sep 12, 2019
1 parent e06478a commit a8774fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion toot/tui/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, data, is_mine, default_instance):
self.reblogged = data.get("reblogged", False)
self.in_reply_to = data.get("in_reply_to_id")

reblog = data.get("reblog")
self.reblog = reblog = data.get("reblog")
self.url = reblog.get("url") if reblog else data.get("url")

def get_author(self):
Expand Down
2 changes: 2 additions & 0 deletions toot/tui/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def __init__(self, status):
created_at = status.created_at.strftime("%Y-%m-%d %H:%M")
favourited = ("yellow", "★") if status.favourited else " "
reblogged = ("yellow", "♺") if status.reblogged else " "
is_reblog = ("cyan", "♺") if status.reblog else " "
is_reply = ("cyan", "⤶") if status.in_reply_to else " "

return super().__init__([
Expand All @@ -327,5 +328,6 @@ def __init__(self, status):
("pack", urwid.Text(" ")),
urwid.Text(("green", status.account), wrap="clip"),
("pack", urwid.Text(is_reply)),
("pack", urwid.Text(is_reblog)),
("pack", urwid.Text(" ")),
])

0 comments on commit a8774fc

Please sign in to comment.