aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2024-07-04 22:41:35 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-04 18:24:42 +0200
commitf913070600236e9298eb5703794665562a348987 (patch)
tree1143203b02158352266e258ef89b590eff2bfa25 /models
parent9ce6f71935945eb44a216d2efe37b1971f799c75 (diff)
downloadaerc-f913070600236e9298eb5703794665562a348987.tar.gz
imap: expose extension in capabilities
Expose the supported extensions in the capabilities. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'models')
-rw-r--r--models/models.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/models/models.go b/models/models.go
index d5a6bd61..e05c81ac 100644
--- a/models/models.go
+++ b/models/models.go
@@ -90,8 +90,18 @@ type DirectoryInfo struct {
// Capabilities provides the backend capabilities
type Capabilities struct {
- Sort bool
- Thread bool
+ Sort bool
+ Thread bool
+ Extensions []string
+}
+
+func (c *Capabilities) Has(s string) bool {
+ for _, ext := range c.Extensions {
+ if ext == s {
+ return true
+ }
+ }
+ return false
}
// A MessageInfo holds information about the structure of a message