home · contact · privacy
Announce explicitly requested disconnecting attempt (to differentiate unrequested...
authorChristian Heller <c.heller@plomlompom.de>
Sun, 10 Aug 2025 12:10:42 +0000 (14:10 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 10 Aug 2025 12:10:42 +0000 (14:10 +0200)
ircplom/client_tui.py

index f40064db676a90f583a7ea61c7faaaab28717053..dfef804cb8b925eac0581701a2d967b2b3d59b3e 100644 (file)
@@ -22,8 +22,9 @@ _STREAM_SAME = '='
 
 class _ClientWindow(Window, ClientQueueMixin):
 
-    def __init__(self, stream: str, **kwargs) -> None:
+    def __init__(self, stream: str, log: Callable, **kwargs) -> None:
         self.stream = stream
+        self._log = log
         super().__init__(**kwargs)
 
     @property
@@ -36,6 +37,7 @@ class _ClientWindow(Window, ClientQueueMixin):
 
     def cmd__disconnect(self, quit_msg: str = 'ircplom says bye') -> None:
         'Send QUIT command to server.'
+        self._log('requesting disconnect …', stream=STREAM_SERVER)
         self._send_msg('QUIT', (quit_msg,))
 
     def cmd__reconnect(self) -> None:
@@ -103,7 +105,7 @@ class _ClientWindowsManager:
     def _new_window(self, stream: str) -> _ClientWindow:
         win_class = (_PrivmsgWindow if stream[0:1] != STREAM_PREFIX_META
                      else _ClientWindow)
-        win = self._tui_new_window(win_class, stream=stream)
+        win = self._tui_new_window(win_class, stream=stream, log=self.log)
         if isinstance(win, _PrivmsgWindow):
             self._prompt_update(win)
         self.windows += [win]