aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/cmds.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/imap/cmds.go')
-rw-r--r--internal/imap/cmds.go27
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})
+}