1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

irc: fix display of outgoing CTCP when channel/private buffer doesn't exist

This commit is contained in:
Sébastien Helleu
2023-05-27 13:59:23 +02:00
parent 3a0141174b
commit a41dff7acc
2 changed files with 25 additions and 8 deletions
+10 -5
View File
@@ -1300,16 +1300,20 @@ irc_ctcp_display_send (struct t_irc_server *server,
const char *target, const char *type, const char *args)
{
struct t_irc_nick *ptr_nick;
int is_channel;
if (weechat_strcasecmp (type, "action") == 0)
{
if (channel
&& irc_server_prefix_char_statusmsg (server, target[0]))
if (!channel || irc_server_prefix_char_statusmsg (server, target[0]))
{
/* STATUSMSG action */
/* no buffer or STATUSMSG action */
is_channel = ((irc_server_prefix_char_statusmsg (server, target[0])
&& irc_channel_is_channel (server, target + 1))
|| irc_channel_is_channel (server, target));
ptr_nick = irc_nick_search (server, channel, server->nick);
weechat_printf_date_tags (
channel->buffer,
(channel) ? channel->buffer : irc_msgbuffer_get_target_buffer (
server, target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (
server,
@@ -1322,7 +1326,8 @@ irc_ctcp_display_send (struct t_irc_server *server,
weechat_prefix ("network"),
/* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me */
_("Action"),
IRC_COLOR_CHAT_CHANNEL,
(is_channel) ?
IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target),
target,
IRC_COLOR_RESET,
irc_nick_mode_for_display (server, ptr_nick, 0),