diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-24 12:21:24 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-28 13:43:05 +0100 |
commit | 7b6733c2fc5e2a0af04d1cc6d5ad5c7f70216411 (patch) | |
tree | 713fd425b45a3ca739005d68f0c8a636b231684f | |
parent | 09ffa57d6e8899543157b01edbbee4b55796bd20 (diff) | |
download | evolution-data-server-7b6733c2fc5e2a0af04d1cc6d5ad5c7f70216411.tar.gz |
Recalculate unread_on_server count after fetching flags.
Since we're not allowed to issue STATUS for the currently-selected mailbox,
the only way to ask the server for the count of unseen messages is to select
some _other_ mailbox and then issue STATUS. Even re-SELECTing the mailbox
doesn't give it, although a 'SEARCH UNSEEN' would do it, if we count the
responses.
But we _can_ work it out from the flags after we fetch them all.
(cherry picked from commit 1e3ec346befcca2b6f6a7bdb78ac0ad3ccd376f4)
-rw-r--r-- | camel/providers/imapx/camel-imapx-server.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c index 13a451b89..437ec5587 100644 --- a/camel/providers/imapx/camel-imapx-server.c +++ b/camel/providers/imapx/camel-imapx-server.c @@ -3422,6 +3422,10 @@ imapx_job_scan_changes_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic) g_free(r->uid); } + /* There's no sane way to get the server-side unseen count on the + select mailbox. So just work it out from the flags */ + ((CamelIMAPXFolder *)job->folder)->unread_on_server = job->folder->summary->unread_count; + g_array_free(job->u.refresh_info.infos, TRUE); imapx_job_done (is, job); camel_imapx_command_free (ic); |