mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-29 04:35:54 -04:00
Fix for boosting of statuses that were previously boosted by others
These wouldn't boost/unboost correctly; now they do.
This commit is contained in:
parent
71a2520198
commit
71da194b76
@ -595,17 +595,17 @@ class TUI(urwid.Frame):
|
|||||||
def async_toggle_reblog(self, timeline, status):
|
def async_toggle_reblog(self, timeline, status):
|
||||||
def _reblog():
|
def _reblog():
|
||||||
logger.info("Reblogging {}".format(status))
|
logger.info("Reblogging {}".format(status))
|
||||||
api.reblog(self.app, self.user, status.id, visibility=get_default_visibility())
|
api.reblog(self.app, self.user, status.original.id, visibility=get_default_visibility())
|
||||||
|
|
||||||
def _unreblog():
|
def _unreblog():
|
||||||
logger.info("Unreblogging {}".format(status))
|
logger.info("Unreblogging {}".format(status))
|
||||||
api.unreblog(self.app, self.user, status.id)
|
api.unreblog(self.app, self.user, status.original.id)
|
||||||
|
|
||||||
def _done(loop):
|
def _done(loop):
|
||||||
# Create a new Status with flipped reblogged flag
|
# Create a new Status with flipped reblogged flag
|
||||||
new_data = status.data
|
new_data = status.data
|
||||||
new_data["reblogged"] = not status.reblogged
|
|
||||||
new_status = self.make_status(new_data)
|
new_status = self.make_status(new_data)
|
||||||
|
new_status.original.reblogged = not status.original.reblogged
|
||||||
timeline.update_status(new_status)
|
timeline.update_status(new_status)
|
||||||
|
|
||||||
# Check if status is rebloggable
|
# Check if status is rebloggable
|
||||||
@ -616,7 +616,7 @@ class TUI(urwid.Frame):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self.run_in_thread(
|
self.run_in_thread(
|
||||||
_unreblog if status.reblogged else _reblog,
|
_unreblog if status.original.reblogged else _reblog,
|
||||||
done_callback=_done
|
done_callback=_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user