/pidgin/main: 78d036e70f8e: Fix #16762 where transient startup s...

Jakub Adam jakub.adam at ktknet.cz
Tue Dec 29 19:49:17 EST 2015


Changeset: 78d036e70f8e79dd324ab699e0d9188240ef343e
Author:	 Jakub Adam <jakub.adam at ktknet.cz>
Date:	 2015-12-29 18:49 -0600
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/78d036e70f8e

Description:

Fix #16762 where transient startup statuses could be deleted on exit

diffstat:

 ChangeLog                 |  2 ++
 libpurple/savedstatuses.c |  6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diffs (44 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@ version 3.0.0 (??/??/????):
 	  non-native plugin support.
 	* Removed flags for manually configuring GnuTLS and NSS. They are now only
 	  recognized through pkg-config. (Michael McConville)
+	* Fixed an issue where transient startup statuses could be deleted
+	  (Jakub Adam) (#16762)
 
 	libpurple:
 	* Specify a different set of encryption ciphers for TLS connections when
diff --git a/libpurple/savedstatuses.c b/libpurple/savedstatuses.c
--- a/libpurple/savedstatuses.c
+++ b/libpurple/savedstatuses.c
@@ -188,16 +188,18 @@ static void
 remove_old_transient_statuses(void)
 {
 	GList *l, *next;
-	PurpleSavedStatus *saved_status, *current_status;
+	PurpleSavedStatus *saved_status, *startup_status, *current_status;
 	int count;
 	time_t creation_time;
 
+	startup_status = purple_savedstatus_get_startup();
 	current_status = purple_savedstatus_get_current();
 
 	/*
 	 * Iterate through the list of saved statuses.  Delete all
 	 * transient statuses except for the first MAX_TRANSIENTS
 	 * (remember, the saved statuses are already sorted by popularity).
+	 * We should also keep the startup status, if any is set.
 	 */
 	count = 0;
 	for (l = saved_statuses; l != NULL; l = next)
@@ -208,7 +210,7 @@ remove_old_transient_statuses(void)
 		{
 			if (count == MAX_TRANSIENTS)
 			{
-				if (saved_status != current_status)
+				if (saved_status != current_status && saved_status != startup_status)
 				{
 					saved_statuses = g_list_remove(saved_statuses, saved_status);
 					creation_time = purple_savedstatus_get_creation_time(saved_status);



More information about the Commits mailing list