changeset 14937:762896fc8449

[gaim-migrate @ 17709] If we're not reporting idleness, we should still be able to auto-away. If "system" idleness is available, use it to determine when to go away; otherwise use "gaim" idleness. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 09 Nov 2006 05:04:41 +0000
parents 5025e146a876
children 4b2ac755d565
files libgaim/idle.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/idle.c	Thu Nov 09 04:49:54 2006 +0000
+++ b/libgaim/idle.c	Thu Nov 09 05:04:41 2006 +0000
@@ -143,6 +143,16 @@
 
 	/* Auto-away stuff */
 	auto_away = gaim_prefs_get_bool("/core/away/away_when_idle");
+
+	/* If we're not reporting idle, we can still do auto-away.
+	 * First try "system" and if that isn't possible, use "gaim" */
+	if (!report_idle && auto_away) {
+		if ((idle_ui_ops != NULL) && (idle_ui_ops->get_time_idle != NULL))
+			time_idle = idle_ui_ops->get_time_idle();
+		else
+			time_idle = time(NULL) - last_active_time;
+	}
+
 	if (auto_away &&
 		(time_idle > (60 * gaim_prefs_get_int("/core/away/mins_before_away"))))
 	{