(mbox_messages_recent): use MU_ATTRIBUTE_IS_UNSEEN.
(mbox_message_unseen): use MU_ATTRIBUTE_IS_UNREAD.
Showing
1 changed file
with
6 additions
and
6 deletions
... | @@ -1774,6 +1774,9 @@ mbox_messages_count (mailbox_t mailbox, size_t *pcount) | ... | @@ -1774,6 +1774,9 @@ mbox_messages_count (mailbox_t mailbox, size_t *pcount) |
1774 | return 0; | 1774 | return 0; |
1775 | } | 1775 | } |
1776 | 1776 | ||
1777 | /* A "recent" message is the one not marked with MU_ATTRIBUTE_SEEN | ||
1778 | ('O' in the Status header), i.e. a message that is first seen | ||
1779 | by the current session (see attributes.h) */ | ||
1777 | static int | 1780 | static int |
1778 | mbox_messages_recent (mailbox_t mailbox, size_t *pcount) | 1781 | mbox_messages_recent (mailbox_t mailbox, size_t *pcount) |
1779 | { | 1782 | { |
... | @@ -1791,15 +1794,14 @@ mbox_messages_recent (mailbox_t mailbox, size_t *pcount) | ... | @@ -1791,15 +1794,14 @@ mbox_messages_recent (mailbox_t mailbox, size_t *pcount) |
1791 | for (recent = j = 0; j < mud->messages_count; j++) | 1794 | for (recent = j = 0; j < mud->messages_count; j++) |
1792 | { | 1795 | { |
1793 | mum = mud->umessages[j]; | 1796 | mum = mud->umessages[j]; |
1794 | if (mum && ((mum->attr_flags == 0) || | 1797 | if (mum && MU_ATTRIBUTE_IS_UNSEEN(mum->attr_flags)) |
1795 | ! ((mum->attr_flags & MU_ATTRIBUTE_SEEN) | ||
1796 | && (mum->attr_flags & MU_ATTRIBUTE_READ)))) | ||
1797 | recent++; | 1798 | recent++; |
1798 | } | 1799 | } |
1799 | *pcount = recent; | 1800 | *pcount = recent; |
1800 | return 0; | 1801 | return 0; |
1801 | } | 1802 | } |
1802 | 1803 | ||
1804 | /* An "unseen" message is the one that has not been read yet */ | ||
1803 | static int | 1805 | static int |
1804 | mbox_message_unseen (mailbox_t mailbox, size_t *pmsgno) | 1806 | mbox_message_unseen (mailbox_t mailbox, size_t *pmsgno) |
1805 | { | 1807 | { |
... | @@ -1817,9 +1819,7 @@ mbox_message_unseen (mailbox_t mailbox, size_t *pmsgno) | ... | @@ -1817,9 +1819,7 @@ mbox_message_unseen (mailbox_t mailbox, size_t *pmsgno) |
1817 | for (unseen = j = 0; j < mud->messages_count; j++) | 1819 | for (unseen = j = 0; j < mud->messages_count; j++) |
1818 | { | 1820 | { |
1819 | mum = mud->umessages[j]; | 1821 | mum = mud->umessages[j]; |
1820 | if (mum && ((mum->attr_flags == 0) || | 1822 | if (mum && MU_ATTRIBUTE_IS_UNREAD(mum->attr_flags)) |
1821 | ! ((mum->attr_flags & MU_ATTRIBUTE_SEEN) | ||
1822 | && (mum->attr_flags & MU_ATTRIBUTE_READ)))) | ||
1823 | { | 1823 | { |
1824 | unseen = j + 1; | 1824 | unseen = j + 1; |
1825 | break; | 1825 | break; | ... | ... |
-
Please register or sign in to post a comment