comparison libgaim/savedstatuses.c @ 14747:091b6ce6372e

[gaim-migrate @ 17504] Don't exclude the current popular status from the popular statuses list. Also, fix selecting a saved status that doesn't apply to the token status account. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 18 Oct 2006 00:54:57 +0000
parents 587268c9c6d7
children c3a7d40d64bb
comparison
equal deleted inserted replaced
14746:54ce6f592b01 14747:091b6ce6372e
698 gaim_savedstatuses_get_popular(unsigned int how_many) 698 gaim_savedstatuses_get_popular(unsigned int how_many)
699 { 699 {
700 GList *popular = NULL; 700 GList *popular = NULL;
701 GList *cur; 701 GList *cur;
702 int i; 702 int i;
703 GaimSavedStatus *current, *next; 703 GaimSavedStatus *next;
704
705 /* We don't want the current status to be in the GList */
706 current = gaim_savedstatus_get_current();
707 704
708 /* Copy 'how_many' elements to a new list */ 705 /* Copy 'how_many' elements to a new list */
709 i = 0; 706 i = 0;
710 cur = saved_statuses; 707 cur = saved_statuses;
711 while ((i < how_many) && (cur != NULL)) 708 while ((i < how_many) && (cur != NULL))
712 { 709 {
713 next = cur->data; 710 next = cur->data;
714 if ((next != current) && (!gaim_savedstatus_is_transient(next) 711 if ((!gaim_savedstatus_is_transient(next)
715 || gaim_savedstatus_get_message(next) != NULL)) 712 || gaim_savedstatus_get_message(next) != NULL))
716 { 713 {
717 popular = g_list_prepend(popular, cur->data); 714 popular = g_list_prepend(popular, cur->data);
718 i++; 715 i++;
719 } 716 }