summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-ctcp.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-05-27 13:59:23 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-05-27 16:49:08 +0200
commita41dff7acc4e0c68bf15bc89ea3ca66ced5205de (patch)
treef91ab84fb3a439a6a9f961bb5aee26d57fe4e99b /src/plugins/irc/irc-ctcp.c
parent3a0141174b6a10f8f4816028f44a9093fb22ce1f (diff)
downloadweechat-a41dff7acc4e0c68bf15bc89ea3ca66ced5205de.zip
irc: fix display of outgoing CTCP when channel/private buffer doesn't exist
Diffstat (limited to 'src/plugins/irc/irc-ctcp.c')
-rw-r--r--src/plugins/irc/irc-ctcp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index 0a0d32900..a84a7dae3 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -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),