merge of '1c196194f91f91332379c6a932f599229885b8cf'

Tue, 16 Oct 2007 06:28:54 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Tue, 16 Oct 2007 06:28:54 +0000
changeset 21040
4a0d5781a7f7
parent 21036
1c196194f91f (current diff)
parent 21039
ea939e518c47 (diff)
child 21041
9613c20b65a5

merge of '1c196194f91f91332379c6a932f599229885b8cf'
and 'ea939e518c47c2173ad25359920ede1d754f31f9'

--- a/ChangeLog.API	Tue Oct 16 04:27:20 2007 +0000
+++ b/ChangeLog.API	Tue Oct 16 06:28:54 2007 +0000
@@ -6,6 +6,10 @@
 		* The size parameter of purple_util_write_data_to_file_absolute
 		  has been changed to gssize instead of a size_t to correctly
 		  indicate that -1 can be used for a nul-delimited string.
+		* The documentation for purple_savedstatuses_get_popular used to
+		  incorrectly claim that the active status is excluded from the
+		  returned list. The documentation has been corrected. Also, the
+		  function now returns a correct list when called with a value of 0.
 
 version 2.2.0 (09/13/2007):
 	libpurple:
--- a/libpurple/savedstatuses.c	Tue Oct 16 04:27:20 2007 +0000
+++ b/libpurple/savedstatuses.c	Tue Oct 16 06:28:54 2007 +0000
@@ -761,10 +761,13 @@
 {
 	GList *popular = NULL;
 	GList *cur;
-	int i;
+	unsigned int i;
 	PurpleSavedStatus *next;
 
-	/* Copy 'how_many' elements to a new list */
+	/* Copy 'how_many' elements to a new list. If 'how_many' is 0, then copy all of 'em. */
+	if (how_many == 0)
+		how_many = (unsigned int) -1;
+
 	i = 0;
 	cur = saved_statuses;
 	while ((i < how_many) && (cur != NULL))
@@ -773,7 +776,7 @@
 		if ((!purple_savedstatus_is_transient(next)
 			|| purple_savedstatus_get_message(next) != NULL))
 		{
-			popular = g_list_prepend(popular, cur->data);
+			popular = g_list_prepend(popular, next);
 			i++;
 		}
 		cur = cur->next;
--- a/libpurple/savedstatuses.h	Tue Oct 16 04:27:20 2007 +0000
+++ b/libpurple/savedstatuses.h	Tue Oct 16 06:28:54 2007 +0000
@@ -170,11 +170,8 @@
 /**
  * Returns the n most popular saved statuses.  "Popularity" is
  * 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.  Also
- * transient statuses without messages are not included in the
- * list.
+ * how many times it has been used. 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

mercurial