1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-25 00:20:55 +01:00

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

This commit is contained in:
Daniel Schwarz 2023-02-02 20:37:12 -05:00 committed by Ivan Habunek
parent 7be30302dc
commit e10fff983f

View File

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