X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fimap.c;h=42a4958f29f95f2e542027e17afa95fecabe2e2b;hp=68cbf7600e533798a379597c6400003d15b09d06;hb=5ce200b94f4941a471b5ee8928c2fb17c0bbc5ea;hpb=467216a618eb1e98180908ad1ed48f6862ecef30 diff --git a/src/imap.c b/src/imap.c index 68cbf7600..42a4958f2 100644 --- a/src/imap.c +++ b/src/imap.c @@ -3008,10 +3008,9 @@ static void *imap_get_uncached_messages_thread(void *data) g_slist_free(tags); continue; } - if (tags != NULL) { - g_slist_free(msginfo->tags); - msginfo->tags = NULL; - } + g_slist_free(msginfo->tags); + msginfo->tags = NULL; + for (cur = tags; cur; cur = cur->next) { gchar *real_tag = imap_modified_utf7_to_utf8(cur->data, TRUE); gint id = 0; @@ -3021,12 +3020,14 @@ static void *imap_get_uncached_messages_thread(void *data) got_alien_tags = TRUE; } if (!g_slist_find(msginfo->tags, GINT_TO_POINTER(id))) { - msginfo->tags = g_slist_append( + msginfo->tags = g_slist_prepend( msginfo->tags, GINT_TO_POINTER(id)); } g_free(real_tag); } + if (msginfo->tags) + msginfo->tags = g_slist_reverse(msginfo->tags); slist_free_strings(tags); g_slist_free(tags); msginfo->folder = item;