From f3b4336bc4d7da716d68629ee18e79a512976f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 14 Oct 2021 20:37:32 +0200 Subject: [PATCH] irc: do not display message with "(null)" for 973/974/975 command received if pos_mode is NULL --- src/plugins/irc/irc-protocol.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index cde702fb7..a6f432e7f 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3057,14 +3057,18 @@ IRC_PROTOCOL_CALLBACK(server_mode_reason) ((argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]) : NULL; } - weechat_printf_date_tags ( - irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, NULL), - "%s%s: %s", - weechat_prefix ("network"), - pos_mode, - (pos_args) ? pos_args : ""); + if (pos_mode) + { + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s%s%s", + weechat_prefix ("network"), + pos_mode, + (pos_args) ? ": " : "", + (pos_args) ? pos_args : ""); + } return WEECHAT_RC_OK; }