From 2111f5c8a3190bc72c4ef089e27abef050babc32 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 12 Nov 2025 12:57:19 +0100 Subject: [PATCH] Handle NOTICE messages from server to channel. --- src/ircplom/msg_parse_expectations.py | 6 ++++++ src/tests/channels.test | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/ircplom/msg_parse_expectations.py b/src/ircplom/msg_parse_expectations.py index a1917a5..27b973e 100644 --- a/src/ircplom/msg_parse_expectations.py +++ b/src/ircplom/msg_parse_expectations.py @@ -505,6 +505,12 @@ MSG_EXPECTATIONS: list[_MsgParseExpectation] = [ ((_MsgTok.NICKNAME, 'setattr_db.users.me:nick'), (_MsgTok.ANY, 'setattr_db.messaging..to.:notice'))), + _MsgParseExpectation( + 'NOTICE', + (_MsgTok.SERVER, ':SERVER'), + ((_MsgTok.CHANNEL, ':CHANNEL'), + (_MsgTok.ANY, 'setattr_db.messaging.SERVER.to.CHANNEL:notice'))), + _MsgParseExpectation( 'NOTICE', (_MsgTok.NICK_USER_HOST, ':USER'), diff --git a/src/tests/channels.test b/src/tests/channels.test index ff8670d..f8fbad4 100644 --- a/src/tests/channels.test +++ b/src/tests/channels.test @@ -154,6 +154,10 @@ log 1 $ users:3:user set to: [~oof] log 1 $ users:3:host set to: [oof.oof] log 3 < (oof) msg_test5 msg_test6 +# check effect of server NOTICE to channel +insert servermsglogged : +0 MSG :*.?.net NOTICE #ch_test0 :msg_test6 msg_test7 +log 3 < (*.?.net) msg_test6 msg_test7 + # check part of user visible in other channel insert servermsglogged : +0 MSG :bar!~bar@bar.bar PART :#ch_test0 log 1 $ channels:#ch_test0:exits:1 set to: [P] -- 2.30.2