[evolution-data-server] Recalculate unread_on_server count after fetching flags.



commit 1e3ec346befcca2b6f6a7bdb78ac0ad3ccd376f4
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.

 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 6db8d12..8e107d5 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -3464,6 +3464,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]