# HG changeset patch # User Richard Laager # Date 1179668925 0 # Node ID a8b4444f25151ea93c2a3d3cf359a380cec75fab # Parent f2d8658b3a866428cfc8d5ec87030bb8c732c3b2 Raise the timeouts one second so they'll work every time (for certain) with g_timeout_add_seconds(), which is documented as, "To allow this grouping, the interval to the first timer is rounded and can deviate up to one second from the specified interval." diff -r f2d8658b3a86 -r a8b4444f2515 libpurple/idle.c --- a/libpurple/idle.c Sat May 19 21:38:47 2007 +0000 +++ b/libpurple/idle.c Sun May 20 13:48:45 2007 +0000 @@ -230,7 +230,11 @@ if (time_until_next_idle_event == 0) idle_timer = 0; else - idle_timer = purple_timeout_add_seconds(time_until_next_idle_event + 1, check_idleness_timer, NULL); + { + /* +1 for the boundary, + * +1 more for g_timeout_add_seconds rounding. */ + idle_timer = purple_timeout_add_seconds(time_until_next_idle_event + 2, check_idleness_timer, NULL); + } return FALSE; } @@ -309,8 +313,10 @@ void purple_idle_init() { - /* Add the timer to check if we're idle */ - idle_timer = purple_timeout_add_seconds((IDLEMARK + 1), check_idleness_timer, NULL); + /* Add the timer to check if we're idle. + * IDLEMARK + 1 as the boundary, + * +1 more for g_timeout_add_seconds rounding. */ + idle_timer = purple_timeout_add_seconds((IDLEMARK + 2), check_idleness_timer, NULL); purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg", purple_idle_get_handle(),