summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-config.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-09-12 10:44:16 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-09-12 10:44:16 +0200
commit26a99c2912a30e994117bae5e042e60b2c229a26 (patch)
tree042e2b4234593b3905b2bf833667ec2e48ca7a8c /src/plugins/irc/irc-config.c
parent5d0ad1f6314e8e24b09fcc8881a1cf65e8fa0468 (diff)
downloadweechat-26a99c2912a30e994117bae5e042e60b2c229a26.zip
Check immediately away nicks on all servers/channels if option irc.network.away_check is changed from 0 to any other value
Diffstat (limited to 'src/plugins/irc/irc-config.c')
-rw-r--r--src/plugins/irc/irc-config.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 0c16f11d6..3f2695567 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -492,13 +492,26 @@ irc_config_change_network_away_check (void *data,
(void) data;
(void) option;
+ /*
+ * if away check was disabled and is now enabled, check now away for all
+ * servers/channels
+ */
+ if (!irc_hook_timer_check_away
+ && (weechat_config_integer (irc_config_network_away_check) > 0))
+ {
+ irc_server_check_away ();
+ }
+
+ /* remove old timer */
if (irc_hook_timer_check_away)
{
weechat_unhook (irc_hook_timer_check_away);
irc_hook_timer_check_away = NULL;
}
+
if (weechat_config_integer (irc_config_network_away_check) > 0)
{
+ /* create new timer */
irc_hook_timer_check_away = weechat_hook_timer (weechat_config_integer (irc_config_network_away_check) * 60 * 1000,
0, 0,
&irc_server_timer_check_away_cb,
@@ -506,7 +519,7 @@ irc_config_change_network_away_check (void *data,
}
else
{
- /* reset away flag for all nicks/chans/servers */
+ /* reset away flag for all servers/channels */
irc_server_remove_away ();
}
}