1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-12-04 14:46:33 -05:00

Indicate if status is a reply in timeline of TUI

This commit is contained in:
Denis Laxalde 2019-08-31 15:24:03 +02:00 committed by Ivan Habunek
parent f9fb7c074a
commit efbaf9e706
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
2 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class Status:
self.author = get_author(data, instance)
self.favourited = data.get("favourited", False)
self.reblogged = data.get("reblogged", False)
self.in_reply_to = data.get("in_reply_to_id")
def get_account(self):
acct = self.data['account']['acct']

View File

@ -56,6 +56,7 @@ class Timeline(urwid.Columns):
"blue": "green_selected",
"green": "green_selected",
"yellow": "green_selected",
"cyan": "green_selected",
None: "green_selected",
})
@ -288,6 +289,7 @@ class StatusListItem(SelectableColumns):
created_at = status.created_at.strftime("%Y-%m-%d %H:%M")
favourited = ("yellow", "") if status.favourited else " "
reblogged = ("yellow", "") if status.reblogged else " "
is_reply = ("cyan", "") if status.in_reply_to else " "
return super().__init__([
("pack", SelectableText(("blue", created_at), wrap="clip")),
@ -297,4 +299,6 @@ class StatusListItem(SelectableColumns):
("pack", urwid.Text(reblogged)),
("pack", urwid.Text(" ")),
urwid.Text(("green", status.account), wrap="clip"),
("pack", urwid.Text(is_reply)),
("pack", urwid.Text(" ")),
])