fix(mail): filter unread messages in beads mode

ListUnread() was returning all messages in beads mode instead of
filtering by the Read field. Apply the same filtering logic used
in legacy mode to both code paths.

Fixes #595

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/dennis
2026-01-16 14:38:53 -08:00
committed by Steve Yegge
parent 29039ed69d
commit a88d2e1a9e

View File

@@ -250,7 +250,6 @@ func (m *Mailbox) listLegacy() ([]*Message, error) {
// ListUnread returns unread (open) messages.
func (m *Mailbox) ListUnread() ([]*Message, error) {
if m.legacy {
all, err := m.List()
if err != nil {
return nil, err
@@ -262,9 +261,6 @@ func (m *Mailbox) ListUnread() ([]*Message, error) {
}
}
return unread, nil
}
// For beads, inbox only returns open (unread) messages
return m.List()
}
// Get returns a message by ID.