From 0babf5db23f6b74b3a94703ed319cc41576ce23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 27 May 2023 09:32:52 +0200 Subject: irc: display STATUSMSG actions differently from standard actions on channels (closes #1577, issue #139) --- tests/unit/plugins/irc/test-irc-protocol.cpp | 29 ++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'tests/unit/plugins') diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 955a2a841..e681fb2a6 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -597,7 +597,8 @@ TEST_GROUP(IrcProtocolWithServer) }; /* - * Tests send of messages to channel and nick, without cap echo-message: + * Tests send of messages to channel (STATUSMSG and normal) and nick, + * without capability "echo-message" enabled: * - message (text) * - notice (/notice) * - action (/me + /ctcp) @@ -629,6 +630,12 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) "irc_privmsg,self_msg,notify_none,no_highlight,prefix_nick_white," "nick_alice,log1"); + /* STATUSMSG message to channel (with /msg @) */ + server_input_data (buffer_server, "/msg @#test msg chan ops"); + CHECK_SENT("PRIVMSG @#test :msg chan ops"); + CHECK_CHAN("--", "Msg(alice) -> @#test: msg chan ops", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* message to a nick (text in private buffer) */ server_input_data (buffer_pv, "msg pv 1"); CHECK_SENT("PRIVMSG bob :msg pv 1"); @@ -649,6 +656,12 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) CHECK_CHAN("--", "Notice(alice) -> #test: notice chan", "irc_notice,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* STATUSMSG notice to channel */ + server_input_data (buffer_server, "/notice @#test notice chan ops"); + CHECK_SENT("NOTICE @#test :notice chan ops"); + CHECK_CHAN("--", "Notice(alice) -> @#test: notice chan ops", + "irc_notice,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* notice to a nick */ server_input_data (buffer_server, "/notice bob notice pv"); CHECK_SENT("NOTICE bob :notice pv"); @@ -662,13 +675,20 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," "nick_alice,log1"); - /* action on channel (with /ctcp) */ - server_input_data (buffer_server, "/ctcp #test ACTION action chan 2"); + /* action on channel (with /ctcp action) */ + server_input_data (buffer_server, "/ctcp #test action action chan 2"); CHECK_SENT("PRIVMSG #test :\01ACTION action chan 2\01"); CHECK_CHAN(" *", "alice action chan 2", "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," "nick_alice,log1"); + /* STATUSMSG action on channel (with /ctcp @ action) */ + server_input_data (buffer_server, "/ctcp @#test action action chan ops"); + CHECK_SENT("PRIVMSG @#test :\01ACTION action chan ops\01"); + CHECK_CHAN("--", "Action -> @#test: alice action chan ops", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + /* action in private (with /me) */ server_input_data (buffer_pv, "/me action pv 1"); CHECK_SENT("PRIVMSG bob :\01ACTION action pv 1\01"); @@ -709,7 +729,8 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) } /* - * Tests send of messages to channel and nick, with cap echo-message: + * Tests send of messages to channel (STATUSMSG and normal) and nick, + * with capability "echo-message" enabled: * - message (text) * - notice (/notice) * - action (/me + /ctcp) -- cgit v1.2.3