From 5b3f2ad4665b2dc1122da66e34858acbec6dade8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 11 Jul 2018 07:36:11 +0200 Subject: [PATCH] irc: add nick, host and log tags in message displayed in private buffer when the nick comes back on the server (closes #1221) --- ChangeLog.adoc | 1 + src/plugins/irc/irc-channel.c | 7 ++++++- src/plugins/irc/irc-protocol.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 602c941e4..93bfe71f5 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -27,6 +27,7 @@ New features:: * core: allow merge of buffers by name in command /buffer (issue #1108, issue #1159) * api: add function hashtable_add_from_infolist() * api: add function string_format_size in scripting API + * irc: add nick, host and log tags in message displayed in private buffer when the nick comes back on the server (issue #1221) * irc: add support for IRCv3.2 chghost, add options irc.look.smart_filter_chghost and irc.color.message_chghost (issue #640) * irc: add support for IRCv3.2 invite-notify (issue #639) * irc: add support for IRCv3.2 Client Capability Negotiation (issue #586, issue #623) diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 89c7cd37d..eb01f87dd 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -35,6 +35,7 @@ #include "irc-config.h" #include "irc-modelist.h" #include "irc-nick.h" +#include "irc-protocol.h" #include "irc-server.h" #include "irc-input.h" @@ -1355,7 +1356,11 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server, weechat_printf_date_tags ( ptr_channel->buffer, 0, - "irc_nick_back", + irc_protocol_tags ( + "nick_back", + NULL, + (nick) ? nick->name : NULL, + (nick) ? nick->host : NULL), _("%s%s%s %s(%s%s%s)%s is back on server"), weechat_prefix ("join"), irc_nick_color_for_msg (server, 1, nick, nickname), diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 4bfdfdf38..cf380b037 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -97,7 +97,8 @@ irc_protocol_log_level_for_command (const char *command) if ((strcmp (command, "join") == 0) || (strcmp (command, "part") == 0) - || (strcmp (command, "quit") == 0)) + || (strcmp (command, "quit") == 0) + || (strcmp (command, "nick_back") == 0)) return 4; return 3;