package jmap import ( "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rockorager/go-jmap" "git.sr.ht/~rockorager/go-jmap/mail/email" "git.sr.ht/~rockorager/go-jmap/mail/mailbox" ) type MailboxState struct { mbox *mailbox.Mailbox dir string queryState string filter *email.FilterCondition sort []*email.SortComparator uids []uint32 } func (s *MailboxState) FullPath(all map[jmap.ID]*MailboxState) string { if s.mbox.ParentID == "" { return s.mbox.Name } parent, ok := all[s.mbox.ParentID] if !ok { return s.mbox.Name } return parent.FullPath(all) + "/" + s.mbox.Name } var jmapRole2aerc = map[mailbox.Role]models.Role{ mailbox.RoleAll: models.AllRole, mailbox.RoleArchive: models.ArchiveRole, mailbox.RoleDrafts: models.DraftsRole, mailbox.RoleInbox: models.InboxRole, mailbox.RoleJunk: models.JunkRole, mailbox.RoleSent: models.SentRole, mailbox.RoleTrash: models.TrashRole, }