Commit 4757badf 4757badffac65c435ab719569008de558928af14 by Sergey Poznyakoff

Do not set first_unread or first_new if the message is marked as deleted.

1 parent e3c7d0d1
...@@ -37,18 +37,20 @@ mail_summary (int argc, char **argv) ...@@ -37,18 +37,20 @@ mail_summary (int argc, char **argv)
37 if ((mailbox_get_message (mbox, msgno, &msg) == 0) 37 if ((mailbox_get_message (mbox, msgno, &msg) == 0)
38 && (message_get_attribute (msg, &attr) == 0)) 38 && (message_get_attribute (msg, &attr) == 0))
39 { 39 {
40 if (attribute_is_deleted (attr)) 40 int deleted = attribute_is_deleted (attr);
41
42 if (deleted)
41 mdelete++; 43 mdelete++;
42 if (attribute_is_seen (attr) && ! attribute_is_read (attr)) 44 if (attribute_is_seen (attr) && ! attribute_is_read (attr))
43 { 45 {
44 mseen++; 46 mseen++;
45 if (!first_unread) 47 if (!deleted && !first_unread)
46 first_unread = msgno; 48 first_unread = msgno;
47 } 49 }
48 if (attribute_is_recent (attr)) 50 if (attribute_is_recent (attr))
49 { 51 {
50 mnew++; 52 mnew++;
51 if (!first_new) 53 if (!deleted && !first_new)
52 first_new = msgno; 54 first_new = msgno;
53 } 55 }
54 } 56 }
......