home · contact · privacy
Remove "requesting disconnect" message unnecessarily complicating log message passing...
authorChristian Heller <c.heller@plomlompom.de>
Tue, 23 Sep 2025 19:33:08 +0000 (21:33 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 23 Sep 2025 19:33:08 +0000 (21:33 +0200)
ircplom/client_tui.py
test.txt

index b6b27229a83daa83c35fc250d2da906c2148e623..0df8c215c81fe9851cdbe594ac1c6339ab1feef4 100644 (file)
@@ -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)
index f1c235b27f91db21ad78636c85936e20ab6de6bd..73b5a7570a82fde0ffb3b89b8120502257e95760 100644 (file)
--- a/test.txt
+++ b/test.txt
 
 # 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]