1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

irc: use parsed command parameters in "privmsg" command callback

This commit is contained in:
Sébastien Helleu
2021-10-14 23:08:45 +02:00
parent 5e712d7145
commit 179822fb91
3 changed files with 63 additions and 50 deletions
+8 -4
View File
@@ -1566,13 +1566,17 @@ TEST(IrcProtocolWithServer, privmsg)
SRV_INIT_JOIN2;
/* not enough arguments */
/* not enough parameters */
RECV(":bob!user@host PRIVMSG");
CHECK_ERROR_ARGS("privmsg", 2, 4);
CHECK_ERROR_PARAMS("privmsg", 0, 2);
RECV(":bob!user@host PRIVMSG #test");
CHECK_ERROR_ARGS("privmsg", 3, 4);
CHECK_ERROR_PARAMS("privmsg", 1, 2);
RECV(":bob!user@host PRIVMSG alice");
CHECK_ERROR_ARGS("privmsg", 3, 4);
CHECK_ERROR_PARAMS("privmsg", 1, 2);
/* missing nick */
RECV("PRIVMSG #test :this is the message");
CHECK_ERROR_NICK("privmsg");
/* message to channel/user */
RECV(":bob!user@host PRIVMSG #test :this is the message");