changeset 13197:22f8ed4e5294

[gaim-migrate @ 15560] Never auto-delete our currently in-use status. I ran into this when I was doing some crazy shit. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 09 Feb 2006 03:14:59 +0000
parents f04dffe22957
children 83b39a76e06e
files src/savedstatuses.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/savedstatuses.c	Thu Feb 09 00:14:40 2006 +0000
+++ b/src/savedstatuses.c	Thu Feb 09 03:14:59 2006 +0000
@@ -181,10 +181,12 @@
 remove_old_transient_statuses()
 {
 	GList *l, *next;
-	GaimSavedStatus *saved_status;
+	GaimSavedStatus *saved_status, *current_status;
 	int count;
 	time_t creation_time;
 
+	current_status = gaim_savedstatus_get_current();
+
 	/*
 	 * Iterate through the list of saved statuses.  Delete all
 	 * transient statuses except for the first MAX_TRANSIENTS
@@ -199,10 +201,13 @@
 		{
 			if (count == MAX_TRANSIENTS)
 			{
-				saved_statuses = g_list_remove(saved_statuses, saved_status);
-				creation_time = gaim_savedstatus_get_creation_time(saved_status);
-				g_hash_table_remove(creation_times, &creation_time);
-				free_saved_status(saved_status);
+				if (saved_status != current_status)
+				{
+					saved_statuses = g_list_remove(saved_statuses, saved_status);
+					creation_time = gaim_savedstatus_get_creation_time(saved_status);
+					g_hash_table_remove(creation_times, &creation_time);
+					free_saved_status(saved_status);
+				}
 			}
 			else
 				count++;