Mercurial > pidgin
diff src/savedstatuses.c @ 13673:5948086807cd
[gaim-migrate @ 16075]
Don't show the current status in the list of popular statuses in
the gtkstatusbox and in the system tray
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Fri, 21 Apr 2006 03:06:19 +0000 |
| parents | d9dbb874a30c |
| children | 53fdb7cc6940 |
line wrap: on
line diff
--- a/src/savedstatuses.c Fri Apr 21 02:48:58 2006 +0000 +++ b/src/savedstatuses.c Fri Apr 21 03:06:19 2006 +0000 @@ -684,18 +684,30 @@ GList * gaim_savedstatuses_get_popular(unsigned int how_many) { - GList *truncated = NULL; + GList *popular = NULL; GList *cur; int i; + GaimSavedStatus *current; + + /* We don't want the current status to be in the GList */ + current = gaim_savedstatus_get_current(); /* Copy 'how_many' elements to a new list */ - for (i = 0, cur = saved_statuses; (i < how_many) && (cur != NULL); i++) + i = 0; + cur = saved_statuses; + while ((i < how_many) && (cur != NULL)) { - truncated = g_list_append(truncated, cur->data); + if (cur->data != current) + { + popular = g_list_prepend(popular, cur->data); + i++; + } cur = cur->next; } - return truncated; + popular = g_list_reverse(popular); + + return popular; } GaimSavedStatus *
