[evolution-data-server/gnome-2-30] Recalculate unread_on_server count after fetching flags.
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-2-30] Recalculate unread_on_server count after fetching flags.
- Date: Mon, 28 Jun 2010 19:36:13 +0000 (UTC)
commit 7b6733c2fc5e2a0af04d1cc6d5ad5c7f70216411
Author: David Woodhouse <David Woodhouse intel com>
Date: Thu Jun 24 12:21:24 2010 +0100
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)
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 13a451b..437ec55 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]