From 056ef9730ab5b417ab6937a2bf6783d2654608ee Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 3 Sep 2025 13:37:52 +0200 Subject: [PATCH] Handle parts with messages. --- ircplom/client.py | 2 ++ ircplom/msg_parse_expectations.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ircplom/client.py b/ircplom/client.py index b1fd4b8..fbdbb83 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -830,6 +830,8 @@ class Client(ABC, ClientQueueMixin): self._log(ret['message'], out=False, **kw) elif ret['verb'] == 'PART': self._db.channels[ret['channel']].remove_nick(ret['parter']) + self._log(f'{ret["parter"]} parts: {ret["message"]}', + LogScope.CHAT, target=ret['channel']) if ret['parter'] == self._db.users['me']: del self._db.channels[ret['channel']] elif ret['verb'] == 'PING': diff --git a/ircplom/msg_parse_expectations.py b/ircplom/msg_parse_expectations.py index 2399169..750c0ae 100644 --- a/ircplom/msg_parse_expectations.py +++ b/ircplom/msg_parse_expectations.py @@ -287,6 +287,10 @@ MSG_EXPECTATIONS += [ _MsgParseExpectation((MsgTok.NICK_USER_HOST, ':parter'), 'PART', ((MsgTok.CHANNEL, ':channel'),)), + _MsgParseExpectation((MsgTok.NICK_USER_HOST, ':parter'), + 'PART', + ((MsgTok.CHANNEL, ':channel'), + (MsgTok.ANY, ':message'))), _MsgParseExpectation((MsgTok.NICK_USER_HOST, ':author'), 'TOPIC', ((MsgTok.CHANNEL, ':channel'), -- 2.30.2