1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

irc: add support of capability "echo-message" (closes #139)

This commit is contained in:
Sébastien Helleu
2023-05-23 21:31:05 +02:00
parent 8f5a3cb639
commit 64c3f3f0cd
27 changed files with 270 additions and 109 deletions
+3 -2
View File
@@ -6927,8 +6927,9 @@ irc_command_init ()
"\n"
"Capabilities supported by WeeChat are: "
"account-notify, away-notify, batch, cap-notify, chghost, "
"draft/multiline, extended-join, invite-notify, message-tags, "
"multi-prefix, server-time, setname, userhost-in-names.\n"
"draft/multiline, echo-message, extended-join, invite-notify, "
"message-tags, multi-prefix, server-time, setname, "
"userhost-in-names.\n"
"\n"
"The capabilities to automatically enable on servers can be set "
"in option irc.server_default.capabilities (or by server in "
+2 -2
View File
@@ -59,8 +59,8 @@ struct t_irc_channel;
*/
#define IRC_COMMAND_CAP_SUPPORTED \
"account-notify|away-notify|batch|cap-notify|chghost|" \
"draft/multiline|extended-join|invite-notify|message-tags|" \
"multi-prefix|server-time|setname|userhost-in-names"
"draft/multiline|echo-message|extended-join|invite-notify|" \
"message-tags|multi-prefix|server-time|setname|userhost-in-names"
/* list of supported CTCPs (for completion in command /ctcp) */
#define IRC_COMMAND_CTCP_SUPPORTED_COMPLETION \
+9 -2
View File
@@ -70,6 +70,15 @@ irc_input_user_message_display (struct t_gui_buffer *buffer,
if (!buffer || !text)
return;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/*
* if capability "echo-message" is enabled, we don't display anything,
* the message will be displayed when server sends it back to us
*/
if (weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
return;
/* if message is an action, force "action" to 1 and extract message */
if (strncmp (text, "\01ACTION ", 8) == 0)
{
@@ -87,8 +96,6 @@ irc_input_user_message_display (struct t_gui_buffer *buffer,
(text2) ? text2 : text,
weechat_config_boolean (irc_config_network_colors_send));
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
if (ptr_channel)
{
ptr_nick = NULL;
+4
View File
@@ -3497,6 +3497,10 @@ IRC_PROTOCOL_CALLBACK(tagmsg)
if (!tags)
return WEECHAT_RC_OK;
/* ignore if coming from self nick (if echo-message is enabled) */
if (irc_server_strcasecmp (server, server->nick, nick) == 0)
return WEECHAT_RC_OK;
ptr_channel = NULL;
if (irc_channel_is_channel (server, params[0]))
ptr_channel = irc_channel_search (server, params[0]);