home · contact · privacy
Add MODE message handler.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 14 Aug 2025 16:39:34 +0000 (18:39 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 14 Aug 2025 16:39:34 +0000 (18:39 +0200)
ircplom/client.py

index dde587230efd5d46cb219a05dab029fc88b9aecf..c71bbfdbff16e1e78fdc2d04cf694a2407c65282 100644 (file)
@@ -180,6 +180,7 @@ class ClientDbBase:
     isupports: list[str]
     motd: list[str]
     nickname: str
+    user_modes: str
 
     def __init__(self) -> None:
         self._dict: dict[str, ClientDbType] = {}
@@ -424,6 +425,9 @@ class Client(ABC, ClientQueueMixin):
                 self.send(IrcMessage(verb='PONG', params=(msg.params[0],)))
             case 'ERROR':
                 self.close()
+            case 'MODE' if (len(msg.params) == 2
+                            and msg.params[0] == self._db.nickname):
+                self._update_db('user_modes', msg.params[1], True)
             case 'NOTICE' | 'PRIVMSG':
                 scope = LogScope.CHAT if '!' in msg.source else LogScope.SERVER
                 self._log(msg.params[-1], scope=scope, channel=msg.params[0],