1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26:37 +02:00

irc: display CTCP reply to a nick in server buffer instead of channel

When a CTCP request is received on a channel, WeeChat replies to the nick and
it is now displayed in the server buffer instead of the channel, as the target
is a nick and not a channel.
This commit is contained in:
Sébastien Helleu
2024-04-06 16:42:15 +02:00
parent d81170b010
commit 74729ce677
2 changed files with 16 additions and 23 deletions
+5 -12
View File
@@ -324,7 +324,6 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt,
void
irc_ctcp_reply_to_nick (struct t_irc_protocol_ctxt *ctxt,
struct t_irc_channel *channel,
const char *ctcp,
const char *arguments)
{
@@ -386,11 +385,8 @@ irc_ctcp_reply_to_nick (struct t_irc_protocol_ctxt *ctxt,
if (!msg_color)
break;
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick,
NULL,
"ctcp",
(channel) ? channel->buffer : NULL),
irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->nick,
NULL, "ctcp", NULL),
0,
irc_protocol_tags (ctxt,
"irc_ctcp,irc_ctcp_reply,self_msg,"
@@ -1498,15 +1494,13 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
reply_eval = irc_ctcp_eval_reply (ctxt->server, reply);
if (reply_eval)
{
irc_ctcp_reply_to_nick (ctxt, channel, ptr_args + 1,
reply_eval);
irc_ctcp_reply_to_nick (ctxt, ptr_args + 1, reply_eval);
free (reply_eval);
}
}
else
{
irc_ctcp_reply_to_nick (ctxt, channel, ptr_args + 1,
pos_args);
irc_ctcp_reply_to_nick (ctxt, ptr_args + 1, pos_args);
}
}
}
@@ -1530,8 +1524,7 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
reply_eval = irc_ctcp_eval_reply (ctxt->server, reply);
if (reply_eval)
{
irc_ctcp_reply_to_nick (ctxt, channel, ptr_args + 1,
reply_eval);
irc_ctcp_reply_to_nick (ctxt, ptr_args + 1, reply_eval);
free (reply_eval);
}
}