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

Add options irc.look.smart_filter_join/quit, smart filter enabled by default

This commit is contained in:
Sebastien Helleu
2010-01-24 13:13:40 +01:00
parent eb56a98fc8
commit c02d70b7ba
3 changed files with 26 additions and 4 deletions
+13 -1
View File
@@ -70,6 +70,8 @@ struct t_config_option *irc_config_look_raw_messages;
struct t_config_option *irc_config_look_show_away_once;
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_topic_strip_colors;
/* IRC config, color section */
@@ -1436,12 +1438,22 @@ irc_config_init ()
N_("filter join/part/quit 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, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_delay = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_delay", "integer",
N_("delay for filtering join/part/quit messages (in minutes)"),
NULL, 1, 60*24*7, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_join = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_join", "boolean",
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",
N_("enable smart filter for \"part\" and \"quit\" messages"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notice_as_pv = weechat_config_new_option (
irc_config_file, ptr_section,
"notice_as_pv", "integer",
+2
View File
@@ -92,6 +92,8 @@ extern struct t_config_option *irc_config_look_raw_messages;
extern struct t_config_option *irc_config_look_show_away_once;
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_topic_strip_colors;
extern struct t_config_option *irc_config_color_message_join;
+11 -3
View File
@@ -364,12 +364,14 @@ irc_protocol_cmd_join (struct t_irc_server *server, const char *command,
if (!irc_ignore_check (server, ptr_channel, nick, host))
{
local_join = (strcmp (nick, server->nick) == 0);
ptr_nick_speaking = (weechat_config_boolean (irc_config_look_smart_filter)) ?
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
&& (weechat_config_boolean (irc_config_look_smart_filter_join))) ?
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
weechat_printf_tags (ptr_channel->buffer,
irc_protocol_tags (command,
(local_join
|| !weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_join)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter"),
_("%s%s%s %s(%s%s%s)%s has joined %s%s%s"),
@@ -949,7 +951,8 @@ irc_protocol_cmd_part (struct t_irc_server *server, const char *command,
/* display part message */
if (!irc_ignore_check (server, ptr_channel, nick, host))
{
ptr_nick_speaking = (weechat_config_boolean (irc_config_look_smart_filter)) ?
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
&& (weechat_config_boolean (irc_config_look_smart_filter_quit))) ?
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
if (pos_comment)
{
@@ -957,6 +960,7 @@ irc_protocol_cmd_part (struct t_irc_server *server, const char *command,
irc_protocol_tags (command,
(local_part
|| !weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter"),
_("%s%s%s %s(%s%s%s)%s has left %s%s%s "
@@ -983,6 +987,7 @@ irc_protocol_cmd_part (struct t_irc_server *server, const char *command,
irc_protocol_tags (command,
(local_part
|| !weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter"),
_("%s%s%s %s(%s%s%s)%s has left "
@@ -1284,7 +1289,8 @@ irc_protocol_cmd_quit (struct t_irc_server *server, const char *command,
if (!irc_ignore_check (server, ptr_channel, nick, host))
{
local_quit = (strcmp (nick, server->nick) == 0);
ptr_nick_speaking = (weechat_config_boolean (irc_config_look_smart_filter)) ?
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
&& (weechat_config_boolean (irc_config_look_smart_filter_quit))) ?
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
if (pos_comment && pos_comment[0])
{
@@ -1292,6 +1298,7 @@ irc_protocol_cmd_quit (struct t_irc_server *server, const char *command,
irc_protocol_tags (command,
(local_quit
|| !weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter"),
_("%s%s%s %s(%s%s%s)%s has quit "
@@ -1316,6 +1323,7 @@ irc_protocol_cmd_quit (struct t_irc_server *server, const char *command,
irc_protocol_tags (command,
(local_quit
|| !weechat_config_boolean (irc_config_look_smart_filter)
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|| ptr_nick_speaking) ?
NULL : "irc_smart_filter"),
_("%s%s%s %s(%s%s%s)%s has quit"),