From 669431702f46eb58f893cbe722040de3792f6b03 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 16 Apr 2023 09:53:45 -0500 Subject: directory: add IANA mailbox roles Add IANA registered mailbox role, and a custom aerc role "query". This will be used in subsequent commits which add the Role field to templates, allowing users to style mailbox by IANA role, or style notmuch queries differently than maildir dirs when using the notmuch worker + maildir option. Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- models/models.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'models') diff --git a/models/models.go b/models/models.go index a47ac24b..1b864341 100644 --- a/models/models.go +++ b/models/models.go @@ -36,6 +36,31 @@ func (f Flags) Has(flags Flags) bool { return f&flags == flags } +type Role string + +var Roles = map[string]Role{ + "all": AllRole, + "archive": ArchiveRole, + "drafts": DraftsRole, + "inbox": InboxRole, + "junk": JunkRole, + "sent": SentRole, + "trash": TrashRole, + "query": QueryRole, +} + +const ( + AllRole Role = "all" + ArchiveRole Role = "archive" + DraftsRole Role = "drafts" + InboxRole Role = "inbox" + JunkRole Role = "junk" + SentRole Role = "sent" + TrashRole Role = "trash" + // Custom aerc roles + QueryRole Role = "query" +) + type Directory struct { Name string // Exists messages in the Directory @@ -44,6 +69,8 @@ type Directory struct { Recent int // Unseen messages in the Directory Unseen int + // IANA role + Role Role } type DirectoryInfo struct { -- cgit