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

Add new option irc.look.smart_filter_nick

This commit is contained in:
Sebastien Helleu
2011-03-07 12:23:32 +01:00
parent f7fd0ae8fc
commit fd0f5f5767
18 changed files with 178 additions and 80 deletions
+11 -2
View File
@@ -90,6 +90,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_quit;
struct t_config_option *irc_config_look_smart_filter_nick;
struct t_config_option *irc_config_look_topic_strip_colors;
/* IRC config, color section */
@@ -2030,8 +2031,8 @@ irc_config_init ()
irc_config_look_smart_filter = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter", "boolean",
N_("filter join/part/quit messages for a nick if not speaking for "
"some minutes on channel (you must create a filter on tag "
N_("filter join/part/quit/nick messages for a nick if not speaking "
"for some minutes on channel (you must create a filter on tag "
"\"irc_smart_filter\")"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_delay = weechat_config_new_option (
@@ -2042,13 +2043,21 @@ irc_config_init ()
irc_config_look_smart_filter_join = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_join", "boolean",
/* TRANSLATORS: please do not translate "join" */
N_("enable smart filter for \"join\" messages"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_quit = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_quit", "boolean",
/* TRANSLATORS: please do not translate "part" and "quit" */
N_("enable smart filter for \"part\" and \"quit\" messages"),
NULL, 0, 0, "on", 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",
/* TRANSLATORS: please do not translate "nick" */
N_("enable smart filter for \"nick\" messages"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_topic_strip_colors = weechat_config_new_option (
irc_config_file, ptr_section,
"topic_strip_colors", "boolean",
+1
View File
@@ -115,6 +115,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_quit;
extern struct t_config_option *irc_config_look_smart_filter_nick;
extern struct t_config_option *irc_config_look_topic_strip_colors;
extern struct t_config_option *irc_config_color_message_join;
+10 -1
View File
@@ -809,6 +809,7 @@ IRC_PROTOCOL_CALLBACK(nick)
struct t_irc_nick *ptr_nick, *ptr_nick_found;
char *new_nick, *old_color, *buffer_name;
int local_nick;
struct t_irc_channel_speaking *ptr_nick_speaking;
/*
* NICK message looks like:
@@ -877,8 +878,16 @@ IRC_PROTOCOL_CALLBACK(nick)
if (!irc_ignore_check (server, ptr_channel->name,
nick, host))
{
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
&& (weechat_config_boolean (irc_config_look_smart_filter_nick))) ?
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
weechat_printf_tags (ptr_channel->buffer,
irc_protocol_tags (command, NULL, NULL),
irc_protocol_tags (command,
(!weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_nick)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter",
NULL),
_("%s%s%s%s is now known as "
"%s%s%s"),
weechat_prefix ("network"),