Support for "account" message - load details and display overlay

pull/308/head
Daniel Schwarz 2023-02-02 20:37:12 -05:00 zatwierdzone przez Ivan Habunek
rodzic 7be30302dc
commit e10fff983f
1 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -11,7 +11,7 @@ from .compose import StatusComposer
from .constants import PALETTE
from .entities import Status
from .overlays import ExceptionStackTrace, GotoMenu, Help, StatusSource, StatusLinks, StatusZoom
from .overlays import StatusDeleteConfirmation
from .overlays import StatusDeleteConfirmation, Account
from .timeline import Timeline
from .utils import parse_content_links, show_media
@ -175,6 +175,9 @@ class TUI(urwid.Frame):
return future
def connect_default_timeline_signals(self, timeline):
def _account(timeline, account_id):
self.show_account(account_id)
def _compose(*args):
self.show_compose()
@ -203,6 +206,7 @@ class TUI(urwid.Frame):
def _clear(*args):
self.clear_screen()
urwid.connect_signal(timeline, "account", _account)
urwid.connect_signal(timeline, "bookmark", self.async_toggle_bookmark)
urwid.connect_signal(timeline, "compose", _compose)
urwid.connect_signal(timeline, "delete", _delete)
@ -504,6 +508,13 @@ class TUI(urwid.Frame):
self.footer.set_message("Status posted {} \\o/".format(status.id))
self.close_overlay()
def show_account(self, account_id):
account = api.whois(self.app, self.user, account_id)
self.open_overlay(
widget=Account(account),
title="Account",
)
def async_toggle_favourite(self, timeline, status):
def _favourite():
logger.info("Favouriting {}".format(status))