From: Christian Heller Date: Sun, 10 Aug 2025 12:10:42 +0000 (+0200) Subject: Announce explicitly requested disconnecting attempt (to differentiate unrequested... X-Git-Url: https://plomlompom.com/repos/booking/%7B%7B%20web_path%20%7D%7D/day?a=commitdiff_plain;h=63b92c81c0936e39589d5cdf991c437fd76cda78;p=ircplom Announce explicitly requested disconnecting attempt (to differentiate unrequested results). --- diff --git a/ircplom/client_tui.py b/ircplom/client_tui.py index f40064d..dfef804 100644 --- a/ircplom/client_tui.py +++ b/ircplom/client_tui.py @@ -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]