mirror of
https://github.com/ihabunek/toot.git
synced 2024-11-03 04:17:21 -05:00
Show number of replies/reblogs/favourites in status footer of curses ui
When parsing "replies_count" from status data, we allow the field to be absent as it got added in version 2.5.0 (in constrast with other ones, added in 0.1.0) as there might be servers with that version around.
This commit is contained in:
parent
4bc963a236
commit
5a867f2380
@ -221,6 +221,12 @@ class StatusDetailWindow:
|
|||||||
if status['reblogged']:
|
if status['reblogged']:
|
||||||
yield "↷ Boosted", Color.CYAN
|
yield "↷ Boosted", Color.CYAN
|
||||||
|
|
||||||
|
yield (
|
||||||
|
"{replies_count} replies, "
|
||||||
|
"{reblogs_count} reblogs, "
|
||||||
|
"{favourites_count} favourites"
|
||||||
|
).format(**status), Color.CYAN
|
||||||
|
|
||||||
def draw(self, status):
|
def draw(self, status):
|
||||||
self.window.erase()
|
self.window.erase()
|
||||||
self.window.box()
|
self.window.box()
|
||||||
|
@ -16,11 +16,14 @@ def parse_status(status):
|
|||||||
'created_at': created_at,
|
'created_at': created_at,
|
||||||
'content': content,
|
'content': content,
|
||||||
'favourited': status.get('favourited'),
|
'favourited': status.get('favourited'),
|
||||||
|
'favourites_count': _status['favourites_count'],
|
||||||
'id': status['id'],
|
'id': status['id'],
|
||||||
'in_reply_to_id': _status.get('in_reply_to_id'),
|
'in_reply_to_id': _status.get('in_reply_to_id'),
|
||||||
'media_attachments': _status['media_attachments'],
|
'media_attachments': _status['media_attachments'],
|
||||||
'url': _status['url'],
|
'url': _status['url'],
|
||||||
'reblogged': status.get('reblogged'),
|
'reblogged': status.get('reblogged'),
|
||||||
|
'reblogs_count': _status['reblogs_count'],
|
||||||
|
'replies_count': _status.get('replies_count', 0),
|
||||||
'spoiler_text': spoiler_text,
|
'spoiler_text': spoiler_text,
|
||||||
'sensitive': _status['sensitive'],
|
'sensitive': _status['sensitive'],
|
||||||
'show_sensitive': False,
|
'show_sensitive': False,
|
||||||
|
Loading…
Reference in New Issue
Block a user