diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-22 19:01:48 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-23 21:49:53 +0200 |
commit | 8f5a3cb639faf3227f9fa4561f77656a59bfbead (patch) | |
tree | 858ae0b80a7d3502d7124b71620ccd456f72a0f4 /tests/unit/plugins | |
parent | 8abde49ba2dc156a23b192e7f87f6f7451efd1b9 (diff) | |
download | weechat-8f5a3cb639faf3227f9fa4561f77656a59bfbead.zip |
irc: fix display of status privmsg/notice, add missing tags in messages (issue #139)
The status PRIVMSG and NOTICE are now displayed the same way for outgoing and
received messages:
Msg(alice) -> @#test: message for ops
Notice(alice) -> @#test: notice for ops
And any message like this is displayed with these tags if the nick is self
nick (case of a bouncer or if capability "echo-message" is enabled):
"self_msg", "notify_none", "no_highlight".
Diffstat (limited to 'tests/unit/plugins')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 4d1b8e726..4f7667251 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -1941,27 +1941,48 @@ TEST(IrcProtocolWithServer, notice) /* notice to channel/user */ RECV(":server.address NOTICE #test :a notice "); - CHECK_CHAN("--", "Notice(server.address): a notice ", + CHECK_CHAN("--", "Notice(server.address) -> #test: a notice ", "irc_notice,notify_message,nick_server.address,log1"); RECV(":server.address NOTICE alice :a notice "); CHECK_SRV("--", "server.address: a notice ", "irc_notice,notify_private,nick_server.address,log1"); RECV(":bob!user@host NOTICE #test :a notice "); - CHECK_CHAN("--", "Notice(bob): a notice ", + CHECK_CHAN("--", "Notice(bob) -> #test: a notice ", "irc_notice,notify_message,nick_bob,host_user@host,log1"); RECV(":bob!user@host NOTICE alice :a notice "); CHECK_SRV("--", "bob (user@host): a notice ", "irc_notice,notify_private,nick_bob,host_user@host,log1"); + /* + * notice to channel/user from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host NOTICE #test :a notice "); + CHECK_CHAN("--", "Notice(alice) -> #test: a notice ", + "irc_notice,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); + /* notice to ops of channel */ RECV(":server.address NOTICE @#test :a notice "); - CHECK_CHAN("--", "Notice:@(server.address): a notice ", + CHECK_CHAN("--", "Notice(server.address) -> @#test: a notice ", "irc_notice,notify_message,nick_server.address,log1"); RECV(":bob!user@host NOTICE @#test :a notice "); - CHECK_CHAN("--", "Notice:@(bob): a notice ", + CHECK_CHAN("--", "Notice(bob) -> @#test: a notice ", "irc_notice,notify_message,nick_bob,host_user@host,log1"); - /* notice from self nick (case of bouncer) */ + /* + * notice to ops of channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host NOTICE @#test :a notice "); + CHECK_CHAN("--", "Notice(alice) -> @#test: a notice ", + "irc_notice,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); + + /* + * notice from self nick + * (case of bouncer of if echo-message capability is enabled) + */ RECV(":alice!user@host NOTICE alice :a notice "); CHECK_SRV("--", "Notice -> alice: a notice ", "irc_notice,notify_private,nick_alice,host_user@host,log1"); @@ -2238,12 +2259,33 @@ TEST(IrcProtocolWithServer, privmsg) "irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2," "notify_private,prefix_nick_248,nick_bob,host_user@host,log1"); + /* + * message to channel/user from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG #test :this is the message "); + CHECK_CHAN("alice", "this is the message ", + "irc_privmsg,self_msg,notify_none,no_highlight," + "prefix_nick_white,nick_alice,host_user@host,log1"); + /* message to ops of channel */ RECV(":bob!user@host PRIVMSG @#test :this is the message "); - CHECK_CHAN("--", "Msg:@(bob): this is the message ", + CHECK_CHAN("--", "Msg(bob) -> @#test: this is the message ", "irc_privmsg,notify_message,nick_bob,host_user@host,log1"); - /* message from self nick (case of bouncer) */ + /* + * message to ops of channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG @#test :this is the message "); + CHECK_CHAN("--", "Msg(alice) -> @#test: this is the message ", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); + + /* + * message from self nick in private + * (case of bouncer of if echo-message capability is enabled) + */ RECV(":alice!user@host PRIVMSG alice :this is the message "); CHECK_PV("alice", "alice", "this is the message ", "irc_privmsg,self_msg,notify_none,no_highlight," |