diff --git a/src/bouncer/client.py b/src/bouncer/client.py index 948b5dc..945a619 100644 --- a/src/bouncer/client.py +++ b/src/bouncer/client.py @@ -112,13 +112,14 @@ class Client: if msg.command == "QUIT": return - # Block direct NICK -- must go through /msg *bouncer NICK - if msg.command == "NICK": - self._send_msg(IRCMessage( - command="NOTICE", - params=[self._nick, "Use /msg *bouncer NICK "], - prefix="*bouncer!bouncer@bouncer", - )) + # Block registration commands -- never forward to networks + if msg.command in ("NICK", "PASS", "USER"): + if msg.command == "NICK": + self._send_msg(IRCMessage( + command="NOTICE", + params=[self._nick, "Use /msg *bouncer NICK "], + prefix="*bouncer!bouncer@bouncer", + )) return # Intercept bouncer control commands