Skip to content

Commit c3eb150

Browse files
committed
imap: add CapSet.CompressAlgorithms
1 parent e082ee9 commit c3eb150

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

capability.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,19 @@ func (set CapSet) AuthMechanisms() []string {
148148
return l
149149
}
150150

151+
// CompressAlgorithms returns the list of supported compresson mechanisms.
152+
func (set CapSet) CompressAlgorithms() []string {
153+
var l []string
154+
for c := range set {
155+
if !strings.HasPrefix(string(c), "COMPRESS=") {
156+
continue
157+
}
158+
algo := strings.TrimPrefix(string(c), "COMPRESS=")
159+
l = append(l, algo)
160+
}
161+
return l
162+
}
163+
151164
// AppendLimit checks the APPENDLIMIT capability.
152165
//
153166
// If the server supports APPENDLIMIT, ok is true. If the server doesn't have

0 commit comments

Comments
 (0)