home · contact · privacy
Remove debugging windows from LogScope.USER for "me".
authorChristian Heller <c.heller@plomlompom.de>
Fri, 19 Sep 2025 23:47:52 +0000 (01:47 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 19 Sep 2025 23:47:52 +0000 (01:47 +0200)
ircplom/client_tui.py
test.txt

index a922560d83ed10bf6db44d361a4ac84d00fd8719..1e1ac248c87bf31cfc399f55eeae58a772d31d41 100644 (file)
@@ -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.'
index d98e2ecae22d465fbf49af6619f416cfeaa973b2..e4c886cd9059cd86883e095849360b1a6073b72d 100644 (file)
--- a/test.txt
+++ b/test.txt
 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