summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-03-07 12:23:32 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-03-07 12:23:32 +0100
commitfd0f5f5767fba191dd087ab392643c12f79026c4 (patch)
treecc82774c43ab6b07556dd60b8f471ee49fdf5d09 /src/plugins
parentf7fd0ae8fccaff2b6e3ea028fba6edfedc9e3360 (diff)
downloadweechat-fd0f5f5767fba191dd087ab392643c12f79026c4.zip
Add new option irc.look.smart_filter_nick
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-config.c13
-rw-r--r--src/plugins/irc/irc-config.h1
-rw-r--r--src/plugins/irc/irc-protocol.c11
3 files changed, 22 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 4c5ef2995..a7e7f3a67 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -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",
diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h
index 2902af8ee..d843cf94f 100644
--- a/src/plugins/irc/irc-config.h
+++ b/src/plugins/irc/irc-config.h
@@ -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;
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index fd518207c..741d30cf6 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -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"),