aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index bbe1f902f6..46e9446566 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -360,8 +360,15 @@ update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info)
unread = camel_folder_get_message_count (folder);
if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
|| folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS)) {
+ guint32 junked = 0;
+
if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0)
unread -= deleted;
+
+ camel_object_get (folder, NULL, CAMEL_FOLDER_JUNKED, &junked, NULL);
+ if (junked > 0)
+ unread -= junked;
+
}
} else {
d(printf(" unread count\n"));