changeset 1029:740c6f933fe0

[gaim-migrate @ 1039] So here's why this needed to be fixed: There is a boolean value (stored as int....), is_idle, in each gc. It's used to indicate whether we've told the server that we're idle. You only need to tell the server once. Before this patch, there were two scenarios: X use and Gaim use. If you had idle set to X use, then you were telling the server every 20 seconds how idle you were. If you had idle set to gaim use, then you were never idle, because you would be updating when your last unidle action was every 20 seconds. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 26 Oct 2000 18:05:29 +0000
parents e4147c8604cc
children 38452403563b
files src/idle.c
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/idle.c	Thu Oct 26 11:48:42 2000 +0000
+++ b/src/idle.c	Thu Oct 26 18:05:29 2000 +0000
@@ -47,7 +47,7 @@
 #endif
 
         /* Not idle, really...  :) */
-        update_all_buddies();
+	update_all_buddies();
 
 	plugin_event(event_blist_update, 0, 0, 0, 0);
         
@@ -55,12 +55,6 @@
 
 	if (report_idle == 0)
                 return TRUE;
-	/*
-	if (gc->is_idle) {
-		fprintf (stderr, "\tgc->is_idle\n");
-		return TRUE;
-	}
-	*/
 
 #ifdef USE_SCREENSAVER
 	if (report_idle == IDLE_SCREENSAVER) {
@@ -75,11 +69,14 @@
 #endif /* USE_SCREENSAVER */
 		idle_time = t - gc->lastsent;
 
-	if (idle_time > 600) { /* 10 minutes! */
+	if (idle_time > 600 && !gc->is_idle) { /* 10 minutes! */
+		debug_printf("setting %s idle %d seconds\n", gc->username, idle_time);
 		serv_set_idle(gc, idle_time);
 		gc->is_idle = 1;
-        } else
+        } else if (idle_time < 600 && gc->is_idle) {
+		debug_printf("setting %s unidle\n", gc->username);
 		serv_touch_idle(gc);
+	}
 
 	return TRUE;