changeset 17088:6545d21b6f5b

Move the time_until_next_idle_event < 0 check to clarify.
author Richard Laager <rlaager@wiktel.com>
date Sat, 19 May 2007 05:56:01 +0000
parents 856a25046228
children e7e033a38612
files libpurple/idle.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/idle.c	Sat May 19 05:53:29 2007 +0000
+++ b/libpurple/idle.c	Sat May 19 05:56:01 2007 +0000
@@ -157,7 +157,12 @@
 			time_idle = time(NULL) - last_active_time;
 	}
 
-	time_until_next_idle_event = IDLEMARK - time_idle; /* reasonable start upperbound */
+	time_until_next_idle_event = IDLEMARK - time_idle;
+	if (time_until_next_idle_event < 0)
+	{
+		/* If we're already idle, check again in a minute. */
+		time_until_next_idle_event = 60;
+	}
 
 	if (auto_away || !no_away)
 		away_seconds = 60 * purple_prefs_get_int("/purple/away/mins_before_away");
@@ -189,9 +194,6 @@
 		while (idled_accts != NULL)
 			set_account_unidle(idled_accts->data);
 	}
-	
-	if (time_until_next_idle_event < 0)
-		time_until_next_idle_event = IDLEMARK;
 }