summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-input.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-10-30 08:23:20 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-10-30 08:23:20 +0100
commit21759171d27d66dcb6dbb96950ac55471d6604a7 (patch)
treeaf7a5f70e3f2699aed48147cc514b8b227a5616d /src/plugins/irc/irc-input.c
parent7406c8b94c32531abaa4907d7857b2a008405eff (diff)
downloadweechat-21759171d27d66dcb6dbb96950ac55471d6604a7.zip
irc: add tags "nick_xxx" and "host_xxx" in all messages, including self and server messages
Diffstat (limited to 'src/plugins/irc/irc-input.c')
-rw-r--r--src/plugins/irc/irc-input.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index e1b5aa7f6..72820cc8a 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -136,6 +136,9 @@ irc_input_user_message_display (struct t_irc_server *server,
if (ptr_channel && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL))
ptr_nick = irc_nick_search (server, ptr_channel, server->nick);
+ ctxt.nick = (ptr_nick) ? ptr_nick->name : server->nick;
+ ctxt.nick_is_me = (irc_server_strcasecmp (server, ctxt.nick, server->nick) == 0);
+
if (is_action)
{
snprintf (str_tags, sizeof (str_tags),
@@ -172,10 +175,7 @@ irc_input_user_message_display (struct t_irc_server *server,
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (&ctxt,
- str_tags,
- (ptr_nick) ? ptr_nick->name : server->nick,
- address),
+ irc_protocol_tags (&ctxt, str_tags),
"%s%s -> %s%s%s: %s%s%s%s%s%s",
weechat_prefix ("network"),
/* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action */
@@ -196,10 +196,7 @@ irc_input_user_message_display (struct t_irc_server *server,
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (&ctxt,
- str_tags,
- (ptr_nick) ? ptr_nick->name : server->nick,
- address),
+ irc_protocol_tags (&ctxt, str_tags),
"%s%s%s%s%s%s%s",
weechat_prefix ("action"),
irc_nick_mode_for_display (server, ptr_nick, 0),
@@ -215,10 +212,7 @@ irc_input_user_message_display (struct t_irc_server *server,
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (&ctxt,
- str_tags,
- (ptr_nick) ? ptr_nick->name : server->nick,
- address),
+ irc_protocol_tags (&ctxt, str_tags),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
(is_channel) ?
@@ -236,10 +230,7 @@ irc_input_user_message_display (struct t_irc_server *server,
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (&ctxt,
- str_tags,
- (ptr_nick) ? ptr_nick->name : server->nick,
- address),
+ irc_protocol_tags (&ctxt, str_tags),
"%s%s%s%s%s(%s%s%s%s)%s -> %s%s%s: %s",
weechat_prefix ("network"),
(is_notice) ? IRC_COLOR_NOTICE : "",
@@ -265,10 +256,7 @@ irc_input_user_message_display (struct t_irc_server *server,
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (&ctxt,
- str_tags,
- (ptr_nick) ? ptr_nick->name : server->nick,
- address),
+ irc_protocol_tags (&ctxt, str_tags),
"%s%s",
irc_nick_as_prefix (
server,