1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

api: run hook_print callback also on empty messages

This commit is contained in:
Sébastien Helleu
2022-07-02 21:10:48 +02:00
parent 749bc26926
commit 1c7b431bc8
5 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -140,7 +140,7 @@ test_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
"%s: \"%s%s%s\"",
buffer_full_name,
(prefix && prefix[0]) ? prefix : "",
(prefix && prefix[0]) ? " " : "",
(prefix && prefix[0] && message && message[0]) ? " " : "",
(message && message[0]) ? message : "");
arraylist_add (recorded_messages, strdup (str_recorded));
}
@@ -150,7 +150,7 @@ test_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
{
printf ("%s%s%s\n", /* with color: "\33[34m%s%s%s\33[0m\n" */
(prefix && prefix[0]) ? prefix : "",
(prefix && prefix[0]) ? " " : "",
(prefix && prefix[0] && message && message[0]) ? " " : "",
(message && message[0]) ? message : "");
}
+4 -4
View File
@@ -2048,7 +2048,7 @@ TEST(IrcProtocolWithServer, 001_empty)
CHECK_ERROR_PARAMS("001", 0, 1);
RECV(":server 001 alice");
CHECK_NO_MSG;
CHECK_SRV("--");
LONGS_EQUAL(1, ptr_server->is_connected);
STRCMP_EQUAL("alice", ptr_server->nick);
}
@@ -2693,7 +2693,7 @@ TEST(IrcProtocolWithServer, 323)
CHECK_ERROR_PARAMS("323", 0, 1);
RECV(":server 323 alice");
CHECK_NO_MSG;
CHECK_SRV("--");
RECV(":server 323 alice end");
CHECK_SRV("-- end");
RECV(":server 323 alice :End of /LIST");
@@ -3999,7 +3999,7 @@ TEST(IrcProtocolWithServer, 732)
CHECK_ERROR_PARAMS("732", 0, 1);
RECV(":server 732 alice");
CHECK_NO_MSG;
CHECK_SRV("--");
RECV(":server 732 alice :nick1!user1@host1,nick2!user2@host2");
CHECK_SRV("-- nick1!user1@host1,nick2!user2@host2");
}
@@ -4018,7 +4018,7 @@ TEST(IrcProtocolWithServer, 733)
CHECK_ERROR_PARAMS("733", 0, 1);
RECV(":server 733 alice");
CHECK_NO_MSG;
CHECK_SRV("--");
RECV(":server 733 alice end");
CHECK_SRV("-- end");
RECV(":server 733 alice :End of MONITOR list");