aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/cmds.go
blob: d978d8093a55f9901c770ed6f0bbb65ccf8a6c1c (plain)
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
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})
}