From: Christian Heller Date: Tue, 19 Aug 2025 02:46:47 +0000 (+0200) Subject: Handle QUIT message, at least inside of channels. X-Git-Url: https://plomlompom.com/repos/process_efforts?a=commitdiff_plain;h=ec1d6bf993436dd8b258daba5c0135d9ca4a11c5;p=ircplom Handle QUIT message, at least inside of channels. --- diff --git a/ircplom/client.py b/ircplom/client.py index 0c2a923..df2fc7d 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -67,6 +67,7 @@ _EXPECTATIONS: dict[str, _MsgParseExpectation] = { 'PART': _MsgParseExpectation(1, 2), 'PING': _MsgParseExpectation(1, source=''), 'PRIVMSG': _MsgParseExpectation(2), + 'QUIT': _MsgParseExpectation(1), } @@ -658,6 +659,14 @@ class Client(ABC, ClientQueueMixin): 'users', msg.nick_from_source, stay_complete=True) elif msg.match('PING'): self.send(IrcMessage(verb='PONG', params=(msg.params[0],))) + elif msg.match('QUIT'): + user = msg.nick_from_source + for chan_name in self._db.chan_names: + chan = self._db.chan(chan_name) + if user in chan.users: + chan.remove_completable('users', user, stay_complete=True) + self._log(f'{user} quits: {msg.params[0]}', + scope=LogScope.CHAT, target=chan_name) else: self._log(f'PLEASE IMPLEMENT HANDLER FOR: {msg.raw}')