1/*
2 * Copyright 2016 Software Freedom Conservancy Inc.
3 *
4 * This software is licensed under the GNU Lesser General Public License
5 * (version 2.1 or later).  See the COPYING file in this distribution.
6 */
7
8/**
9 * A representation of the IMAP APPEND command.
10 *
11 * See [[http://tools.ietf.org/html/rfc3501#section-6.3.11]]
12 */
13public class Geary.Imap.AppendCommand : Command {
14
15    public const string NAME = "append";
16
17    public AppendCommand(MailboxSpecifier mailbox,
18                         MessageFlags? flags,
19                         InternalDate? internal_date,
20                         Memory.Buffer message,
21                         GLib.Cancellable? should_send) {
22        base(NAME, null, should_send);
23
24        this.args.add(mailbox.to_parameter());
25
26        if (flags != null && flags.size > 0) {
27            this.args.add(flags.to_parameter());
28        }
29
30        if (internal_date != null) {
31            this.args.add(internal_date.to_parameter());
32        }
33
34        this.args.add(new LiteralParameter(message));
35    }
36
37}
38