Skip to content

Add RenameOptions #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: v2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion imapclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,9 @@ func (c *Client) Delete(mailbox string) *Command {
}

// Rename sends a RENAME command.
func (c *Client) Rename(mailbox, newName string) *Command {
//
// A nil options pointer is equivalent to a zero options value.
func (c *Client) Rename(mailbox, newName string, options *imap.RenameOptions) *Command {
cmd := &Command{}
enc := c.beginCommand("RENAME", cmd)
enc.SP().Mailbox(mailbox).SP().Mailbox(newName)
Expand Down
2 changes: 1 addition & 1 deletion imapserver/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func (c *Conn) handleRename(dec *imapwire.Decoder) error {
if err := c.checkState(imap.ConnStateAuthenticated); err != nil {
return err
}
return c.session.Rename(oldName, newName)
return c.session.Rename(oldName, newName, &imap.RenameOptions{})
}

func (c *Conn) handleSubscribe(dec *imapwire.Decoder) error {
Expand Down
2 changes: 1 addition & 1 deletion imapserver/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type Session interface {
Select(mailbox string, options *imap.SelectOptions) (*imap.SelectData, error)
Create(mailbox string, options *imap.CreateOptions) error
Delete(mailbox string) error
Rename(mailbox, newName string) error
Rename(mailbox, newName string, options *imap.RenameOptions) error
Subscribe(mailbox string) error
Unsubscribe(mailbox string) error
List(w *ListWriter, ref string, patterns []string, options *imap.ListOptions) error
Expand Down