Update vendor/

This commit is contained in:
2018-06-28 01:09:56 +01:00
parent 3e5ab5bb0a
commit 21c6e571d8
108 changed files with 121110 additions and 1144 deletions

View File

@@ -2,7 +2,6 @@ package server
import (
"errors"
"strings"
"github.com/emersion/go-imap"
"github.com/emersion/go-imap/commands"
@@ -53,12 +52,8 @@ func (cmd *Close) Handle(conn Conn) error {
ctx.Mailbox = nil
ctx.MailboxReadOnly = false
if err := mailbox.Expunge(); err != nil {
return err
}
// No need to send expunge updates here, since the mailbox is already unselected
return nil
return mailbox.Expunge()
}
type Expunge struct {
@@ -206,15 +201,10 @@ func (cmd *Store) handle(uid bool, conn Conn) error {
return ErrMailboxReadOnly
}
itemStr := cmd.Item
silent := strings.HasSuffix(itemStr, imap.SilentOp)
if silent {
itemStr = strings.TrimSuffix(itemStr, imap.SilentOp)
}
item := imap.FlagsOp(itemStr)
if item != imap.SetFlags && item != imap.AddFlags && item != imap.RemoveFlags {
return errors.New("Unsupported STORE operation")
// Only flags operations are supported
op, silent, err := imap.ParseFlagsOp(cmd.Item)
if err != nil {
return err
}
flagsList, ok := cmd.Value.([]interface{})
@@ -233,7 +223,7 @@ func (cmd *Store) handle(uid bool, conn Conn) error {
// from receiving them
// TODO: find a better way to do this, without conn.silent
*conn.silent() = silent
err = ctx.Mailbox.UpdateMessagesFlags(uid, cmd.SeqSet, item, flags)
err = ctx.Mailbox.UpdateMessagesFlags(uid, cmd.SeqSet, op, flags)
*conn.silent() = false
if err != nil {
return err
@@ -244,7 +234,7 @@ func (cmd *Store) handle(uid bool, conn Conn) error {
if conn.Server().Updates == nil && !silent {
inner := &Fetch{}
inner.SeqSet = cmd.SeqSet
inner.Items = []string{"FLAGS"}
inner.Items = []imap.FetchItem{imap.FetchFlags}
if uid {
inner.Items = append(inner.Items, "UID")
}
@@ -307,7 +297,7 @@ func (cmd *Uid) Handle(conn Conn) error {
}
return ErrStatusResp(&imap.StatusResp{
Type: imap.StatusOk,
Info: imap.Uid + " " + inner.Name + " completed",
Type: imap.StatusRespOk,
Info: "UID " + inner.Name + " completed",
})
}