diff libpurple/idle.c @ 18106:40d51793f2d7

propagate from branch 'im.pidgin.pidgin.2.1.0' (head d8c7c08339ae468cb4298f6850eb7d3b760ad7b5) to branch 'im.pidgin.pidgin' (head 7f1ffdbda951c2effec7bfbfa8148e9ce98e7669)
author Sean Egan <seanegan@gmail.com>
date Fri, 15 Jun 2007 19:34:24 +0000
parents 81d42bfe31fa 4ca97b26a8fb
children 59aec2d6ec43 69febfa6d307
line wrap: on
line diff
--- a/libpurple/idle.c	Fri Jun 15 19:07:02 2007 +0000
+++ b/libpurple/idle.c	Fri Jun 15 19:34:24 2007 +0000
@@ -199,7 +199,7 @@
 	/* Idle reporting stuff */
 	if (report_idle && (time_idle >= IDLEMARK))
 	{
-		GList *l;
+		const GList *l;
 		for (l = purple_connections_get_all(); l != NULL; l = l->next)
 		{
 			PurpleConnection *gc = l->data;
@@ -224,7 +224,11 @@
 	if (time_until_next_idle_event == 0)
 		idle_timer = 0;
 	else
-		idle_timer = purple_timeout_add(1000 * (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;
 }
 
@@ -311,8 +315,10 @@
 void
 purple_idle_init()
 {
-	/* Add the timer to check if we're idle */
-	idle_timer = purple_timeout_add(1000 * (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(),