diff src/gtkidle.c @ 12125:3c1bac709234

[gaim-migrate @ 14425] Change /core/savedstatus/current and /core/savedstatus/idleaway to ints (they used to be strings, where the value was the title of a GaimSavedStatus). The value is now equal to the "creation" timestamp of a saved_status. The creation timestamp is used as the unique key. The primary reason for this is to allow for saved statuses to have NULL titles. NULL titles are needed for transient statuses. I also added a "last_used" timestamp. This all paves the way for keeping track of recently used statuses committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Nov 2005 07:23:29 +0000
parents 355c7acbb61d
children 891aeb151590
line wrap: on
line diff
--- a/src/gtkidle.c	Fri Nov 18 06:35:07 2005 +0000
+++ b/src/gtkidle.c	Fri Nov 18 07:23:29 2005 +0000
@@ -159,17 +159,14 @@
 	{
 		if (gaim_presence_is_available(presence))
 		{
-			const char *idleaway_name;
 			GaimSavedStatus *saved_status;
 
 			gaim_debug_info("idle", "Making %s auto-away\n",
 							gaim_account_get_username(account));
 
 			/* Mark our accounts "away" using the idleaway status */
-			idleaway_name = gaim_prefs_get_string("/core/savedstatus/idleaway");
-			saved_status = gaim_savedstatus_find(idleaway_name);
-			if (saved_status)
-				gaim_savedstatus_activate_for_account(saved_status, account);
+			saved_status = gaim_savedstatus_get_idleaway();
+			gaim_savedstatus_activate_for_account(saved_status, account);
 
 			gc->is_auto_away = GAIM_IDLE_AUTO_AWAY;
 		} else {
@@ -180,7 +177,6 @@
 			idle_time < 60 * gaim_prefs_get_int("/core/away/mins_before_away"))
 	{
 		/* Return from being idle */
-		const char *idleaway_name;
 		GaimSavedStatus *saved_status;
 
 		if (gc->is_auto_away == GAIM_IDLE_AWAY_BUT_NOT_AUTO_AWAY) {
@@ -192,10 +188,8 @@
 							gaim_account_get_username(account));
 
 			/* Return our account to its previous status */
-			idleaway_name = gaim_prefs_get_string("/core/savedstatus/current");
-			saved_status = gaim_savedstatus_find(idleaway_name);
-			if (saved_status)
-				gaim_savedstatus_activate_for_account(saved_status, account);
+			saved_status = gaim_savedstatus_get_idleaway();
+			gaim_savedstatus_activate_for_account(saved_status, account);
 		}
 	}
 	/* End of auto-away stuff */