Show error if trying to boost unboostables in TUI

This commit is contained in:
Lim Ding Wen 2022-12-22 04:16:03 +08:00 committed by Ivan Habunek
parent 29ff629464
commit 5c98d4ac80
2 changed files with 8 additions and 0 deletions

View File

@ -497,6 +497,13 @@ class TUI(urwid.Frame):
new_status = self.make_status(new_data)
timeline.update_status(new_status)
# Check if status is rebloggable
no_reblog_because_private = status.visibility == "private" and not status.is_mine
no_reblog_because_direct = status.visibility == "direct"
if no_reblog_because_private or no_reblog_because_direct:
self.footer.set_error_message("You may not reblog this {} status".format(status.visibility))
return
self.run_in_thread(
_unreblog if status.reblogged else _reblog,
done_callback=_done

View File

@ -60,6 +60,7 @@ class Status:
self.url = data.get("url")
self.mentions = data.get("mentions")
self.reblog = self._get_reblog()
self.visibility = data.get("visibility")
@property
def original(self):