summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-05-27 15:56:07 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-05-27 16:49:08 +0200
commit1651c48856e45d27800890092d402615645bc95d (patch)
tree3a391fbc2ec289d3fe26cc5c33fdf146539f8e6a /src/plugins
parent649b9d0ca69a5655be17ad808b5121cb62a825b9 (diff)
downloadweechat-1651c48856e45d27800890092d402615645bc95d.zip
irc: add missing host tag in self messages with cap echo-message enabled (issue #139)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-command.c2
-rw-r--r--src/plugins/irc/irc-ctcp.c10
-rw-r--r--src/plugins/irc/irc-ctcp.h4
-rw-r--r--src/plugins/irc/irc-protocol.c7
4 files changed, 13 insertions, 10 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 1d2d88d29..707c4bd60 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1941,7 +1941,7 @@ IRC_COMMAND_CALLBACK(ctcp)
&& irc_channel_is_channel (ptr_server, ctcp_target + 1)) ?
ctcp_target + 1 : ctcp_target);
irc_ctcp_display_send (ptr_server, ptr_channel_target,
- ctcp_target, ctcp_type, ctcp_args);
+ ctcp_target, NULL, ctcp_type, ctcp_args);
}
irc_ctcp_send (ptr_server, ctcp_target, ctcp_type, ctcp_args);
}
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index a84a7dae3..92e50dfa3 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -1297,7 +1297,8 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date,
void
irc_ctcp_display_send (struct t_irc_server *server,
struct t_irc_channel *channel,
- const char *target, const char *type, const char *args)
+ const char *target, const char *address,
+ const char *type, const char *args)
{
struct t_irc_nick *ptr_nick;
int is_channel;
@@ -1321,7 +1322,7 @@ irc_ctcp_display_send (struct t_irc_server *server,
NULL,
"irc_action,self_msg,notify_none,no_highlight",
server->nick,
- NULL),
+ address),
"%s%s -> %s%s%s: %s%s%s%s%s%s",
weechat_prefix ("network"),
/* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me */
@@ -1350,7 +1351,7 @@ irc_ctcp_display_send (struct t_irc_server *server,
NULL,
"irc_action,self_msg,notify_none,no_highlight",
server->nick,
- NULL),
+ address),
"%s%s%s%s%s%s",
weechat_prefix ("action"),
IRC_COLOR_CHAT_NICK_SELF,
@@ -1371,7 +1372,8 @@ irc_ctcp_display_send (struct t_irc_server *server,
"privmsg",
NULL,
"irc_ctcp,self_msg,notify_none,no_highlight",
- NULL, NULL),
+ NULL,
+ address),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
(channel) ?
diff --git a/src/plugins/irc/irc-ctcp.h b/src/plugins/irc/irc-ctcp.h
index f2fd5b667..830bd038a 100644
--- a/src/plugins/irc/irc-ctcp.h
+++ b/src/plugins/irc/irc-ctcp.h
@@ -51,8 +51,8 @@ extern void irc_ctcp_recv (struct t_irc_server *server, time_t date,
const char *message);
extern void irc_ctcp_display_send (struct t_irc_server *server,
struct t_irc_channel *channel,
- const char *target, const char *type,
- const char *args);
+ const char *target, const char *address,
+ const char *type, const char *args);
extern void irc_ctcp_send (struct t_irc_server *server,
const char *target, const char *type,
const char *args);
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 3e0d241de..e62ad6d1e 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -2961,6 +2961,7 @@ void
irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server,
struct t_irc_channel *channel,
const char *target,
+ const char *address,
const char *arguments)
{
const char *pos_space, *pos_end;
@@ -2982,7 +2983,7 @@ irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server,
ctcp_args = (pos_space) ?
weechat_strndup (pos_space + 1, pos_end - pos_space - 1) : NULL;
- irc_ctcp_display_send (server, channel, target, ctcp_type, ctcp_args);
+ irc_ctcp_display_send (server, channel, target, address, ctcp_type, ctcp_args);
if (ctcp_type)
free (ctcp_type);
@@ -3054,7 +3055,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
if (nick_is_me)
{
irc_protocol_privmsg_display_ctcp_send (
- server, ptr_channel, params[0], msg_args);
+ server, ptr_channel, params[0], address, msg_args);
}
else
{
@@ -3162,7 +3163,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
if (nick_is_me)
{
irc_protocol_privmsg_display_ctcp_send (
- server, ptr_channel, remote_nick, msg_args);
+ server, ptr_channel, remote_nick, address, msg_args);
}
else
{