home · contact · privacy
Handle 401 for query windows.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 19 Aug 2025 02:54:44 +0000 (04:54 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 19 Aug 2025 02:54:44 +0000 (04:54 +0200)
ircplom/client.py

index df2fc7d1bac9a06e6e21791489429eef74e68fc1..d1c2deef9ffcdb3570af291d322c00c1bbceea2d 100644 (file)
@@ -26,6 +26,7 @@ _NUMERICS_TO_CONFIRM_NICKNAME = (
     372,
     (375, 376),
     396,
+    401,
     900,
     903,
     904
@@ -52,6 +53,7 @@ _EXPECTATIONS: dict[str, _MsgParseExpectation] = {
    '372': _MsgParseExpectation(2),
    '376': _MsgParseExpectation(2),
    '396': _MsgParseExpectation(3),
+   '401': _MsgParseExpectation(3),
    '432': _MsgParseExpectation(3),
    '433': _MsgParseExpectation(3),
    '900': _MsgParseExpectation(4),
@@ -588,6 +590,9 @@ class Client(ABC, ClientQueueMixin):
             # '@'-split because <https://defs.ircdocs.horse/defs/numerics>
             # claims: "<hostname> can also be in the form <user@hostname>"
             self._db.client_host = msg.params[1].split('@')[-1]
+        elif msg.match('401'):  # ERR_NOSUCHNICK
+            self._log(f'{msg.params[1]} not online', scope=LogScope.CHAT,
+                      target=msg.params[1], alert=True)
         elif msg.match('432'):  # ERR_ERRONEOUSNICKNAME
             alert = 'nickname refused for bad format'
             if msg.params[0] == '*':