changeset 13675:53fdb7cc6940

[gaim-migrate @ 16077] Don't show simple transient statuses in the list of popular statuses in the gtkstatusbox or in the docklet. i.e. don't show "Available" twice. The argument in favor of showing "Available" without a message is that you don't have to wait for the timeout before the status is activated. I don't think the added confusion of people saying "Why does it say available 2 times?!" is worth this ability. And you can still create a basic saved status with no message if you want that functionality. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 21 Apr 2006 04:03:53 +0000
parents 183c177d8cdd
children 1f1dc7f4cd29
files src/savedstatuses.c src/savedstatuses.h
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/savedstatuses.c	Fri Apr 21 03:54:35 2006 +0000
+++ b/src/savedstatuses.c	Fri Apr 21 04:03:53 2006 +0000
@@ -687,7 +687,7 @@
 	GList *popular = NULL;
 	GList *cur;
 	int i;
-	GaimSavedStatus *current;
+	GaimSavedStatus *current, *next;
 
 	/* We don't want the current status to be in the GList */
 	current = gaim_savedstatus_get_current();
@@ -697,7 +697,9 @@
 	cur = saved_statuses;
 	while ((i < how_many) && (cur != NULL))
 	{
-		if (cur->data != current)
+		next = cur->data;
+		if ((next != current) && (!gaim_savedstatus_is_transient(next)
+			|| gaim_savedstatus_get_message(next) != NULL))
 		{
 			popular = g_list_prepend(popular, cur->data);
 			i++;
--- a/src/savedstatuses.h	Fri Apr 21 03:54:35 2006 +0000
+++ b/src/savedstatuses.h	Fri Apr 21 04:03:53 2006 +0000
@@ -156,7 +156,9 @@
  * determined by when the last time a saved_status was used and
  * how many times it has been used.  If the current status would
  * normally show up in this list, then it is omited and instead
- * the "how_many+1" saved status will appear in the list.
+ * the "how_many+1" saved status will appear in the list.  Also
+ * transient statuses without messages are not included in the
+ * list.
  *
  * @param how_many The maximum number of saved statuses
  *                 to return, or '0' to get all saved