1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

irc: fix display of actions sent with /me (issue #139)

This commit is contained in:
Sébastien Helleu
2023-05-25 22:34:03 +02:00
parent d9789e522f
commit e50be16730
4 changed files with 53 additions and 26 deletions
+1 -1
View File
@@ -1913,7 +1913,7 @@ IRC_COMMAND_CALLBACK(ctcp)
/* display message only if capability "echo-message" is NOT enabled */
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
{
irc_ctcp_display_send (ptr_server, ctcp_target, ctcp_type,
irc_ctcp_display_send (ptr_server, NULL, ctcp_target, ctcp_type,
ctcp_args);
}
irc_ctcp_send (ptr_server, ctcp_target, ctcp_type, ctcp_args);
+45 -20
View File
@@ -1262,28 +1262,53 @@ 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)
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (
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 (server, 0, NULL, target),
target,
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
type,
IRC_COLOR_RESET,
(args && args[0]) ? " " : "",
(args && args[0]) ? args : "");
if (weechat_strcasecmp (type, "action") == 0)
{
weechat_printf_date_tags (
(channel) ? channel->buffer : irc_msgbuffer_get_target_buffer (
server, target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (
server,
"privmsg",
NULL,
"irc_action,self_msg,notify_none,no_highlight",
NULL, NULL),
"%s%s%s%s%s%s",
weechat_prefix ("action"),
IRC_COLOR_CHAT_NICK_SELF,
server->nick,
(args && args[0]) ? IRC_COLOR_RESET : "",
(args && args[0]) ? " " : "",
(args && args[0]) ? args : "");
}
else
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, target, NULL, "ctcp", NULL),
0,
irc_protocol_tags (
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"),
(channel) ?
IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target),
target,
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
type,
IRC_COLOR_RESET,
(args && args[0]) ? " " : "",
(args && args[0]) ? args : "");
}
}
/*
+1
View File
@@ -50,6 +50,7 @@ extern void irc_ctcp_recv (struct t_irc_server *server, time_t date,
const char *remote_nick, const char *arguments,
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);
extern void irc_ctcp_send (struct t_irc_server *server,
+6 -5
View File
@@ -2959,6 +2959,7 @@ IRC_PROTOCOL_CALLBACK(pong)
void
irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server,
struct t_irc_channel *channel,
const char *target,
const char *arguments)
{
@@ -2981,7 +2982,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, target, ctcp_type, ctcp_args);
irc_ctcp_display_send (server, channel, target, ctcp_type, ctcp_args);
if (ctcp_type)
free (ctcp_type);
@@ -3052,8 +3053,8 @@ IRC_PROTOCOL_CALLBACK(privmsg)
{
if (nick_is_me)
{
irc_protocol_privmsg_display_ctcp_send (server, pos_target,
msg_args);
irc_protocol_privmsg_display_ctcp_send (
server, ptr_channel, pos_target, msg_args);
}
else
{
@@ -3156,8 +3157,8 @@ IRC_PROTOCOL_CALLBACK(privmsg)
{
if (nick_is_me)
{
irc_protocol_privmsg_display_ctcp_send (server, remote_nick,
msg_args);
irc_protocol_privmsg_display_ctcp_send (
server, NULL, remote_nick, msg_args);
}
else
{