From: Christian Heller Date: Tue, 23 Sep 2025 19:33:08 +0000 (+0200) Subject: Remove "requesting disconnect" message unnecessarily complicating log message passing... X-Git-Url: https://plomlompom.com/repos/?a=commitdiff_plain;h=9bc59b5b892b00145056595ce5c3b43dbfd70883;p=ircplom Remove "requesting disconnect" message unnecessarily complicating log message passing infrastructure. --- diff --git a/ircplom/client_tui.py b/ircplom/client_tui.py index b6b2722..0df8c21 100644 --- a/ircplom/client_tui.py +++ b/ircplom/client_tui.py @@ -37,9 +37,8 @@ class _LogScope(Enum): class _ClientWindow(Window, ClientQueueMixin): - def __init__(self, scope: _LogScope, log: Callable, **kwargs) -> None: + def __init__(self, scope: _LogScope, **kwargs) -> None: self.scope = scope - self._log = log super().__init__(**kwargs) self._title = f'{self.client_id} '\ + f':{"DEBUG" if self.scope == _LogScope.DEBUG else "RAW"}' @@ -49,7 +48,6 @@ class _ClientWindow(Window, ClientQueueMixin): def cmd__disconnect(self, quit_msg: str = 'ircplom says bye') -> None: 'Send QUIT command to server.' - self._log('requesting disconnect …', scope=_LogScope.DEBUG) self._send_msg('QUIT', (quit_msg,)) def cmd__reconnect(self) -> None: @@ -311,7 +309,7 @@ class _ClientWindowsManager: self._new_win(_LogScope.DEBUG) def _new_win(self, scope: _LogScope, chatname: str = '') -> _ClientWindow: - kwargs = {'scope': scope, 'log': self.log, 'win_cls': _ClientWindow} + kwargs = {'scope': scope, 'win_cls': _ClientWindow} if scope == _LogScope.CHAT: kwargs['win_cls'] = ( _ChannelWindow if self.db.is_chan_name(chatname) diff --git a/test.txt b/test.txt index f1c235b..73b5a75 100644 --- a/test.txt +++ b/test.txt @@ -347,7 +347,6 @@ # handle /disconnect, clear all > /disconnect -1,2 $ requesting disconnect … 2 > QUIT :ircplom says bye 0:2 < :foo1!~foobarbaz@baz.bar.foo QUIT :Client Quit 1,2 $ users:me:exit_msg set to: [QClient Quit]