summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:43 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:43 +0200
commit796609174e5ecb35fab992969e7690186840048a (patch)
tree1e4370d47f2a5c050b768c228e73e028a6611cb8 /src/time
parent312fe18cb5f97143f3600b207e979bc559256b6f (diff)
tagging ychat-0.7.3ychat-0.7.3
Diffstat (limited to 'src/time')
-rwxr-xr-xsrc/time/timr.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/time/timr.cpp b/src/time/timr.cpp
index 91dc7f7..fa308d3 100755
--- a/src/time/timr.cpp
+++ b/src/time/timr.cpp
@@ -68,7 +68,7 @@ timr::start( void *v_pointer )
time_now = *localtime( &clock_now );
- // set the current time && the current yhttpd uptime!
+ // set the current time && the current ychat uptime!
set_time( difftime( clock_now, clock_start ),
time_now.tm_sec, time_now.tm_min, time_now.tm_hour );
#ifdef NCURSES
@@ -81,10 +81,27 @@ timr::start( void *v_pointer )
#ifdef SERVMSG
cout << TIMERUP << get_uptime() << endl;
#endif
+ //<<*
+ int* i_timeout_settings = new int[3];
+ i_timeout_settings[0] = tool::string2int(wrap::CONF->get_elem("chat.idle.timeout"));
+ i_timeout_settings[1] = tool::string2int(wrap::CONF->get_elem("chat.idle.awaytimeout"));
+ i_timeout_settings[2] = tool::string2int(wrap::CONF->get_elem("chat.idle.autoawaytimeout"));
+ wrap::CHAT->check_timeout( i_timeout_settings );
+ delete i_timeout_settings;
+
+ string s_ping = "<!-- PING! //-->\n";
+ wrap::CHAT->msg_post( &s_ping );
+
+#ifdef DATABASE
+ // Disconnecting idle database conenction
+ wrap::DATA->check_data_con_timeout();
+#endif
+ //*>>
// run every ten minutes:
if ( time_now.tm_min % 10 == 0 )
{
+ wrap::GCOL->remove_garbage(); //<<
// run every hour
if ( time_now.tm_hour % 60 == 0 )