1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
package response
import (
"fmt"
"github.com/ProtonMail/gluon/imap"
"golang.org/x/exp/slices"
)
type itemCapability struct {
caps []imap.Capability
}
func ItemCapability(caps ...imap.Capability) *itemCapability {
return &itemCapability{
caps: caps,
}
}
func (r *itemCapability) String() string {
var caps []string
for _, capability := range r.caps {
caps = append(caps, string(capability))
}
slices.Sort(caps)
return fmt.Sprintf("CAPABILITY %v", join(caps))
}
|