- Add `role` field to Mailbox model (surfacing what was already stored in DB) - IMAP sync: map enough_mail special-use flags (RFC 6154) to role strings - JMAP: role was already synced to DB, now passed through _toModel() - Add MailboxRepository.findMailboxByRole() for role-based lookup - EmailListScreen: swipe right → archive, swipe left → delete (Dismissible) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
663 B
Dart
23 lines
663 B
Dart
/// A mailbox / folder within an account (maps to an IMAP mailbox).
|
|
class Mailbox {
|
|
final String id; // "<accountId>:<path>"
|
|
final String accountId;
|
|
final String path; // e.g. "INBOX", "Sent", "INBOX/Work"
|
|
final String name; // last path component
|
|
final int unreadCount;
|
|
final int totalCount;
|
|
// JMAP role (RFC 8621) or mapped from IMAP special-use (RFC 6154).
|
|
// e.g. "inbox", "sent", "drafts", "junk", "trash", "archive"
|
|
final String? role;
|
|
|
|
const Mailbox({
|
|
required this.id,
|
|
required this.accountId,
|
|
required this.path,
|
|
required this.name,
|
|
required this.unreadCount,
|
|
required this.totalCount,
|
|
this.role,
|
|
});
|
|
}
|