1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Add posted status / reply to the top of the timeline on submit

This commit is contained in:
Derek Schmidt 2019-03-29 15:49:24 -07:00 committed by Ivan Habunek
parent 2a6206903f
commit 747c5a611f
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -575,6 +575,10 @@ class TimelineApp:
self.footer.draw_message("Submitting status...", Color.YELLOW) self.footer.draw_message("Submitting status...", Color.YELLOW)
response = api.post_status(app, user, content, spoiler_text=cw, sensitive=cw is not None) response = api.post_status(app, user, content, spoiler_text=cw, sensitive=cw is not None)
status = parse_status(response)
self.statuses.insert(0, status)
self.selected += 1
self.left.draw_statuses(self.statuses, self.selected)
self.footer.draw_message("✓ Status posted", Color.GREEN) self.footer.draw_message("✓ Status posted", Color.GREEN)
def reply(self): def reply(self):
@ -596,6 +600,10 @@ class TimelineApp:
self.footer.draw_message("Submitting reply...", Color.YELLOW) self.footer.draw_message("Submitting reply...", Color.YELLOW)
response = api.post_status(app, user, content, spoiler_text=cw, sensitive=cw is not None, in_reply_to_id=status['id']) response = api.post_status(app, user, content, spoiler_text=cw, sensitive=cw is not None, in_reply_to_id=status['id'])
status = parse_status(response)
self.statuses.insert(0, status)
self.selected += 1
self.left.draw_statuses(self.statuses, self.selected)
self.footer.draw_message("✓ Reply posted", Color.GREEN) self.footer.draw_message("✓ Reply posted", Color.GREEN)
def toggle_reblog(self): def toggle_reblog(self):