mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
irc: add alias "ctcp" for target buffer of CTCP messages
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "irc-display.h"
|
||||
#include "irc-ignore.h"
|
||||
#include "irc-input.h"
|
||||
#include "irc-msgbuffer.h"
|
||||
#include "irc-nick.h"
|
||||
#include "irc-notify.h"
|
||||
#include "irc-protocol.h"
|
||||
@@ -941,7 +942,10 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
"PRIVMSG %s :\01PING %s\01",
|
||||
argv[1], str_time);
|
||||
weechat_printf (ptr_server->buffer,
|
||||
weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server,
|
||||
argv[1],
|
||||
NULL, "ctcp",
|
||||
NULL),
|
||||
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
|
||||
weechat_prefix ("network"),
|
||||
IRC_COLOR_CHAT_NICK,
|
||||
@@ -961,7 +965,10 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
irc_cmd,
|
||||
(argv_eol[3]) ? " " : "",
|
||||
(argv_eol[3]) ? argv_eol[3] : "");
|
||||
weechat_printf (ptr_server->buffer,
|
||||
weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server,
|
||||
argv[1],
|
||||
NULL, "ctcp",
|
||||
NULL),
|
||||
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
|
||||
weechat_prefix ("network"),
|
||||
IRC_COLOR_CHAT_NICK,
|
||||
@@ -2802,7 +2809,11 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
break;
|
||||
string = irc_color_decode (str_args,
|
||||
weechat_config_boolean (irc_config_network_colors_receive));
|
||||
weechat_printf_tags ((ptr_channel) ? ptr_channel->buffer : ptr_server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (ptr_server,
|
||||
argv[arg_target],
|
||||
"notice",
|
||||
NULL,
|
||||
(ptr_channel) ? ptr_channel->buffer : NULL),
|
||||
"notify_none,no_highlight",
|
||||
"%s%s%s%s -> %s%s%s: %s",
|
||||
weechat_prefix ("network"),
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "irc-channel.h"
|
||||
#include "irc-color.h"
|
||||
#include "irc-config.h"
|
||||
#include "irc-msgbuffer.h"
|
||||
#include "irc-nick.h"
|
||||
#include "irc-protocol.h"
|
||||
#include "irc-server.h"
|
||||
@@ -120,7 +121,9 @@ irc_ctcp_display_request (struct t_irc_server *server,
|
||||
&& !weechat_config_boolean (irc_config_look_display_ctcp_blocked))
|
||||
return;
|
||||
|
||||
weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, nick,
|
||||
NULL, "ctcp",
|
||||
(channel) ? channel->buffer : NULL),
|
||||
irc_protocol_tags (command, "irc_ctcp", NULL),
|
||||
_("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"),
|
||||
weechat_prefix ("network"),
|
||||
@@ -178,8 +181,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
|
||||
|
||||
difftime = ((sec2 * 1000000) + usec2) -
|
||||
((sec1 * 1000000) + usec1);
|
||||
|
||||
weechat_printf_tags (server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
|
||||
nick,
|
||||
NULL,
|
||||
"ctcp",
|
||||
NULL),
|
||||
irc_protocol_tags (command,
|
||||
"irc_ctcp",
|
||||
NULL),
|
||||
@@ -202,7 +208,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf_tags (server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
|
||||
nick,
|
||||
NULL,
|
||||
"ctcp",
|
||||
NULL),
|
||||
irc_protocol_tags (command,
|
||||
"irc_ctcp",
|
||||
NULL),
|
||||
@@ -221,7 +231,9 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf_tags (server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, nick,
|
||||
NULL, "ctcp",
|
||||
NULL),
|
||||
irc_protocol_tags (command, NULL, NULL),
|
||||
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
|
||||
weechat_prefix ("network"),
|
||||
@@ -277,7 +289,11 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
str_args = weechat_hashtable_get (hashtable, hash_key);
|
||||
if (!str_args)
|
||||
break;
|
||||
weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
|
||||
nick,
|
||||
NULL,
|
||||
"ctcp",
|
||||
(channel) ? channel->buffer : NULL),
|
||||
irc_protocol_tags (command,
|
||||
"irc_ctcp,irc_ctcp_reply,"
|
||||
"notify_none,no_highlight",
|
||||
@@ -1010,7 +1026,11 @@ irc_ctcp_recv (struct t_irc_server *server, const char *command,
|
||||
{
|
||||
if (weechat_config_boolean (irc_config_look_display_ctcp_unknown))
|
||||
{
|
||||
weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
|
||||
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
|
||||
nick,
|
||||
NULL,
|
||||
"ctcp",
|
||||
(channel) ? channel->buffer : NULL),
|
||||
irc_protocol_tags (command,
|
||||
"irc_ctcp",
|
||||
NULL),
|
||||
|
||||
@@ -93,7 +93,10 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_weechat_plugin *buffer_plugin;
|
||||
|
||||
ptr_option = irc_msgbuffer_get_option (server, message);
|
||||
ptr_option = NULL;
|
||||
|
||||
if (message && message[0])
|
||||
ptr_option = irc_msgbuffer_get_option (server, message);
|
||||
if (!ptr_option && alias && alias[0])
|
||||
ptr_option = irc_msgbuffer_get_option (server, alias);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user