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

irc: hide CTCP messages sent with /ctcp when capability "echo-message" is enabled (issue #139)

This commit is contained in:
Sébastien Helleu
2023-05-25 19:22:40 +02:00
parent 3a8525bb95
commit 45fb1ae4ba
+24 -19
View File
@@ -1915,25 +1915,30 @@ IRC_COMMAND_CALLBACK(ctcp)
ctcp_type,
(ctcp_args) ? " " : "",
(ctcp_args) ? ctcp_args : "");
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
ptr_server, ctcp_target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (ptr_server,
"privmsg",
NULL,
"irc_ctcp,self_msg,notify_none,no_highlight",
NULL, NULL),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (ptr_server, 0, NULL, ctcp_target),
ctcp_target,
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
ctcp_type,
IRC_COLOR_RESET,
(ctcp_args) ? " " : "",
(ctcp_args) ? ctcp_args : "");
/* display message only if capability "echo-message" is NOT enabled */
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
ptr_server, ctcp_target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (
ptr_server,
"privmsg",
NULL,
"irc_ctcp,self_msg,notify_none,no_highlight",
NULL, NULL),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (ptr_server, 0, NULL, ctcp_target),
ctcp_target,
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
ctcp_type,
IRC_COLOR_RESET,
(ctcp_args) ? " " : "",
(ctcp_args) ? ctcp_args : "");
}
}
}