From: Christian Heller Date: Fri, 19 Sep 2025 23:47:52 +0000 (+0200) Subject: Remove debugging windows from LogScope.USER for "me". X-Git-Url: https://plomlompom.com/repos/booking/pick_tasks?a=commitdiff_plain;h=c0afaf747c75595a05bbd1bb495eec32e114268a;p=ircplom Remove debugging windows from LogScope.USER for "me". --- diff --git a/ircplom/client_tui.py b/ircplom/client_tui.py index a922560..1e1ac24 100644 --- a/ircplom/client_tui.py +++ b/ircplom/client_tui.py @@ -319,8 +319,6 @@ class _ClientWindowsManager: def windows_for_userid(self, user_id: str, w_channels=True ) -> list[_ClientWindow]: 'Return windows interacting with userid (all if "me").' - if user_id == 'me': - return self.windows[:] chan_names = [c for c, v in self.db.channels.items() if user_id in v.user_ids] return [w for w in self.windows @@ -328,9 +326,9 @@ class _ClientWindowsManager: and isinstance(w, _ChannelWindow) and w.chatname in chan_names) or (isinstance(w, _QueryWindow) - and w.chatname in { + and (user_id == 'me' or w.chatname in { self.db.users[user_id].nick, - self.db.users[user_id].prev_nick}))] + self.db.users[user_id].prev_nick})))] def log(self, msg: str, scope: LogScope, **kwargs) -> None: 'From parsing scope, kwargs, build prefix before sending to logger.' diff --git a/test.txt b/test.txt index d98e2ec..e4c886c 100644 --- a/test.txt +++ b/test.txt @@ -319,7 +319,7 @@ 1,2 $ requesting disconnect … 2 > QUIT :ircplom says bye 2 < :foo!~foobarbaz@baz.bar.foo QUIT :Client Quit -1,2,3,4,5,6 $ foo!~foobarbaz@baz.bar.foo quits: Client Quit +3,6 $ foo!~foobarbaz@baz.bar.foo quits: Client Quit 1,2 $ channels:#testtest:exits:me set to: [QClient Quit] 1,2 $ channels:#testtest:user_ids set to: 5 $ quits: foo!~foobarbaz@baz.bar.foo: Client Quit