mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 16:25:42 +02:00
irc: add option irc.look.smart_filter_mode (task #12499)
This commit is contained in:
@@ -99,6 +99,7 @@ struct t_config_option *irc_config_look_smart_filter;
|
||||
struct t_config_option *irc_config_look_smart_filter_delay;
|
||||
struct t_config_option *irc_config_look_smart_filter_join;
|
||||
struct t_config_option *irc_config_look_smart_filter_join_unmask;
|
||||
struct t_config_option *irc_config_look_smart_filter_mode;
|
||||
struct t_config_option *irc_config_look_smart_filter_nick;
|
||||
struct t_config_option *irc_config_look_smart_filter_quit;
|
||||
struct t_config_option *irc_config_look_topic_strip_colors;
|
||||
@@ -2569,6 +2570,15 @@ irc_config_init ()
|
||||
"update on topic), the join is unmasked, as well as nick changes "
|
||||
"after this join (0 = disable: never unmask a join)"),
|
||||
NULL, 0, 60*24*7, "30", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_smart_filter_mode = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"smart_filter_mode", "string",
|
||||
/* TRANSLATORS: please do not translate "mode" */
|
||||
N_("enable smart filter for \"mode\" messages: \"*\" to filter all "
|
||||
"modes, \"xyz\" to filter only modes x/y/z, \"-xyz\" to filter all "
|
||||
"modes but not x/y/z; examples: \"ovh\": filter modes o/v/h, "
|
||||
"\"-bkl\": filter all modes but not b/k/l"),
|
||||
NULL, 0, 0, "ovh", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_smart_filter_nick = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"smart_filter_nick", "boolean",
|
||||
|
||||
@@ -147,6 +147,7 @@ extern struct t_config_option *irc_config_look_smart_filter;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_delay;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_join;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_join_unmask;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_mode;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_nick;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_quit;
|
||||
extern struct t_config_option *irc_config_look_topic_strip_colors;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,9 +23,9 @@
|
||||
struct t_irc_server;
|
||||
struct t_irc_channel;
|
||||
|
||||
extern void irc_mode_channel_set (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *modes);
|
||||
extern int irc_mode_channel_set (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *modes);
|
||||
extern void irc_mode_user_set (struct t_irc_server *server, const char *modes,
|
||||
int reset_modes);
|
||||
|
||||
|
||||
@@ -848,6 +848,7 @@ IRC_PROTOCOL_CALLBACK(kill)
|
||||
IRC_PROTOCOL_CALLBACK(mode)
|
||||
{
|
||||
char *pos_modes;
|
||||
int smart_filter, local_mode;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
@@ -859,16 +860,24 @@ IRC_PROTOCOL_CALLBACK(mode)
|
||||
|
||||
if (irc_channel_is_channel (server, argv[2]))
|
||||
{
|
||||
smart_filter = 0;
|
||||
ptr_channel = irc_channel_search (server, argv[2]);
|
||||
if (ptr_channel)
|
||||
irc_mode_channel_set (server, ptr_channel, pos_modes);
|
||||
{
|
||||
smart_filter = irc_mode_channel_set (server, ptr_channel,
|
||||
pos_modes);
|
||||
}
|
||||
local_mode = (irc_server_strcasecmp (server, nick, server->nick) == 0);
|
||||
ptr_nick = irc_nick_search (server, ptr_channel, nick);
|
||||
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
|
||||
weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL,
|
||||
command, NULL,
|
||||
ptr_buffer),
|
||||
date,
|
||||
irc_protocol_tags (command, NULL, NULL),
|
||||
irc_protocol_tags (command,
|
||||
(smart_filter && !local_mode) ?
|
||||
"irc_smart_filter" : NULL,
|
||||
NULL),
|
||||
_("%sMode %s%s %s[%s%s%s]%s by %s%s"),
|
||||
weechat_prefix ("network"),
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
@@ -2923,8 +2932,8 @@ IRC_PROTOCOL_CALLBACK(324)
|
||||
irc_channel_set_modes (ptr_channel, ((argc > 4) ? argv_eol[4] : NULL));
|
||||
if (argc > 4)
|
||||
{
|
||||
irc_mode_channel_set (server, ptr_channel,
|
||||
ptr_channel->modes);
|
||||
(void) irc_mode_channel_set (server, ptr_channel,
|
||||
ptr_channel->modes);
|
||||
}
|
||||
}
|
||||
weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL,
|
||||
|
||||
Reference in New Issue
Block a user