Show error if trying to boost unboostables in TUI

pull/276/head
Lim Ding Wen 2022-12-22 04:16:03 +08:00 zatwierdzone przez Ivan Habunek
rodzic 29ff629464
commit 5c98d4ac80
2 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -497,6 +497,13 @@ class TUI(urwid.Frame):
new_status = self.make_status(new_data) new_status = self.make_status(new_data)
timeline.update_status(new_status) 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( self.run_in_thread(
_unreblog if status.reblogged else _reblog, _unreblog if status.reblogged else _reblog,
done_callback=_done done_callback=_done

Wyświetl plik

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