Files
sharedinbox/lib/core/models/mailbox.dart
T
Thomas GüttlerandClaude Sonnet 4.6 544cd9b335 feat: swipe to archive/delete in email list, with role-based mailbox lookup
- 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>
2026-04-24 08:31:22 +02:00

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,
});
}