From 463d5fd26a654417ca7d6e8f5e6a619f6f0df5ac Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Mon, 17 Apr 2006 10:54:11 +0000 Subject: [PATCH] 2006-04-17 [colin] 2.1.1cvs4 * src/imap.c Don't fetch REPLIED and DELETED flags when synchronising flags with a closed folder. We only need UNSEEN and FLAGGED to update the folderview. --- ChangeLog | 7 +++++ PATCHSETS | 1 + configure.ac | 2 +- src/imap.c | 74 +++++++++++++++++++++++++++++----------------------- 4 files changed, 51 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab799b1cb..d056f6211 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-04-17 [colin] 2.1.1cvs4 + + * src/imap.c + Don't fetch REPLIED and DELETED flags when synchronising + flags with a closed folder. We only need UNSEEN and FLAGGED + to update the folderview. + 2006-04-17 [colin] 2.1.1cvs3 * src/imap.c diff --git a/PATCHSETS b/PATCHSETS index 1cbd4e171..27fb3f551 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -1425,3 +1425,4 @@ ( cvs diff -u -r 1.654.2.1467 -r 1.654.2.1468 configure.ac; ) > 2.1.1cvs1.patchset ( cvs diff -u -r 1.9.2.4 -r 1.9.2.5 po/cs.po; cvs diff -u -r 1.58.2.20 -r 1.58.2.21 po/de.po; cvs diff -u -r 1.42.2.22 -r 1.42.2.23 po/fr.po; cvs diff -u -r 1.28.2.5 -r 1.28.2.6 po/nl.po; cvs diff -u -r 1.50.2.16 -r 1.50.2.17 po/pt_BR.po; ) > 2.1.1cvs2.patchset ( cvs diff -u -r 1.179.2.99 -r 1.179.2.100 src/imap.c; ) > 2.1.1cvs3.patchset +( cvs diff -u -r 1.179.2.100 -r 1.179.2.101 src/imap.c; ) > 2.1.1cvs4.patchset diff --git a/configure.ac b/configure.ac index 148a012ec..2d1412708 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=1 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=3 +EXTRA_VERSION=4 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/imap.c b/src/imap.c index 3813a7f0b..d4a52feb9 100644 --- a/src/imap.c +++ b/src/imap.c @@ -3672,37 +3672,39 @@ static /*gint*/ void *imap_get_flags_thread(void *data) unseen = g_slist_concat(unseen, uidlist); } - r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_ANSWERED, - imapset, &lep_uidlist); - if (r == MAILIMAP_NO_ERROR) { - GSList * uidlist; - - uidlist = imap_uid_list_from_lep(lep_uidlist); - mailimap_search_result_free(lep_uidlist); - - answered = g_slist_concat(answered, uidlist); - } - r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_FLAGGED, imapset, &lep_uidlist); if (r == MAILIMAP_NO_ERROR) { GSList * uidlist; - + uidlist = imap_uid_list_from_lep(lep_uidlist); mailimap_search_result_free(lep_uidlist); - + flagged = g_slist_concat(flagged, uidlist); } - - r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_DELETED, - imapset, &lep_uidlist); - if (r == MAILIMAP_NO_ERROR) { - GSList * uidlist; - - uidlist = imap_uid_list_from_lep(lep_uidlist); - mailimap_search_result_free(lep_uidlist); - - deleted = g_slist_concat(deleted, uidlist); + + if (item->opened || item->processing_pending) { + r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_ANSWERED, + imapset, &lep_uidlist); + if (r == MAILIMAP_NO_ERROR) { + GSList * uidlist; + + uidlist = imap_uid_list_from_lep(lep_uidlist); + mailimap_search_result_free(lep_uidlist); + + answered = g_slist_concat(answered, uidlist); + } + + r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_DELETED, + imapset, &lep_uidlist); + if (r == MAILIMAP_NO_ERROR) { + GSList * uidlist; + + uidlist = imap_uid_list_from_lep(lep_uidlist); + mailimap_search_result_free(lep_uidlist); + + deleted = g_slist_concat(deleted, uidlist); + } } } @@ -3719,7 +3721,11 @@ static /*gint*/ void *imap_get_flags_thread(void *data) msginfo = (MsgInfo *) elem->data; flags = msginfo->flags.perm_flags; wasnew = (flags & MSG_NEW); - flags &= ~((reverse_seen ? 0 : MSG_UNREAD | MSG_NEW) | MSG_REPLIED | MSG_MARKED); + if (item->opened || item->processing_pending) { + flags &= ~((reverse_seen ? 0 : MSG_UNREAD | MSG_NEW) | MSG_REPLIED | MSG_MARKED); + } else { + flags &= ~((reverse_seen ? 0 : MSG_UNREAD | MSG_NEW | MSG_MARKED)); + } if (reverse_seen) flags |= MSG_UNREAD | (wasnew ? MSG_NEW : 0); if (gslist_find_next_num(&p_unseen, msginfo->msgnum) == msginfo->msgnum) { @@ -3729,18 +3735,22 @@ static /*gint*/ void *imap_get_flags_thread(void *data) flags &= ~(MSG_UNREAD | MSG_NEW); } } - if (gslist_find_next_num(&p_answered, msginfo->msgnum) == msginfo->msgnum) - flags |= MSG_REPLIED; - else - flags &= ~MSG_REPLIED; + if (gslist_find_next_num(&p_flagged, msginfo->msgnum) == msginfo->msgnum) flags |= MSG_MARKED; else flags &= ~MSG_MARKED; - if (gslist_find_next_num(&p_deleted, msginfo->msgnum) == msginfo->msgnum) - flags |= MSG_DELETED; - else - flags &= ~MSG_DELETED; + + if (item->opened || item->processing_pending) { + if (gslist_find_next_num(&p_answered, msginfo->msgnum) == msginfo->msgnum) + flags |= MSG_REPLIED; + else + flags &= ~MSG_REPLIED; + if (gslist_find_next_num(&p_deleted, msginfo->msgnum) == msginfo->msgnum) + flags |= MSG_DELETED; + else + flags &= ~MSG_DELETED; + } g_relation_insert(msgflags, msginfo, GINT_TO_POINTER(flags)); } -- 2.25.1