/pidgin/main: 968ef3b0caed: Fix #16762 where transient startup s...

Jakub Adam <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 968ef3b0caed9cbf01d19fd4cfd0bcc51e376ce1
Author:	 Jakub Adam <[email protected]>
Date:	 2015-12-29 18:41 -0600
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/968ef3b0caed

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
@@ -3,6 +3,8 @@ Pidgin and Finch: The Pimpin' Penguin IM
 version 2.10.12 (MM/DD/YY):
 	General:
 	* purple-url-handler now works with Python 3.x (Daniël van Eeden)
+	* Fixed an issue where transient startup statuses could be deleted
+	  (Jakub Adam) (#16762)
 
 	Pidgin:
 	* The shout smile now matches the default theme (Steve Vaught)
diff --git a/libpurple/savedstatuses.c b/libpurple/savedstatuses.c
--- a/libpurple/savedstatuses.c
+++ b/libpurple/savedstatuses.c
@@ -193,16 +193,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)
@@ -213,7 +215,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);

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.