diff options
Diffstat (limited to '')
-rw-r--r-- | internal/imap/cmds.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/imap/cmds.go b/internal/imap/cmds.go new file mode 100644 index 0000000..499d6c0 --- /dev/null +++ b/internal/imap/cmds.go @@ -0,0 +1,27 @@ +package imap + +type ensureCommando struct { + folder Folder +} + +func (cmd ensureCommando) execute(conn *connection) error { + return conn.ensureFolder(cmd.folder) +} + +func (client *Client) EnsureFolder(folder Folder) error { + return client.commander.execute(ensureCommando{folder}) +} + + +type addCommando struct { + folder Folder + messages []string +} + +func (cmd addCommando) execute(conn *connection) error { + return conn.putMessages(cmd.folder, cmd.messages) +} + +func (client *Client) PutMessages(folder Folder, messages []string) error { + return client.commander.execute(addCommando{folder, messages}) +} |