diff options
author | Jason Cox <me@jasoncarloscox.com> | 2024-01-25 08:25:51 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-26 21:36:15 +0100 |
commit | 11b035f120969758d1b08dddd761f9375504de55 (patch) | |
tree | bf028d7155ceb45deba3461cb73ed74413f3d965 /worker/jmap | |
parent | 0aab8ac318f6dee479afba13d09a5d1d1c0baa91 (diff) | |
download | aerc-11b035f120969758d1b08dddd761f9375504de55.tar.gz |
flags: add support for draft flag
Support the draft flag wherever flags are used. Automatically set it
when postponing a message, and allow recalling a message without the -f
flag if it has the draft flag set, regardless of what folder it's in.
Notmuch doesn't seem to pick up on the draft flag when indexing even
though the flag is set on the maildir file. Explicitly set all tags
corresponding to set flags when appending a message in notmuch.
Changelog-added: Support the `draft` flag.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/jmap')
-rw-r--r-- | worker/jmap/jmap.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/worker/jmap/jmap.go b/worker/jmap/jmap.go index 8012b6e4..bb0f75f9 100644 --- a/worker/jmap/jmap.go +++ b/worker/jmap/jmap.go @@ -67,6 +67,9 @@ func flagsToKeywords(flags models.Flags) map[string]bool { if flags.Has(models.FlaggedFlag) { kw["$flagged"] = true } + if flags.Has(models.DraftFlag) { + kw["$draft"] = true + } return kw } @@ -81,6 +84,8 @@ func keywordsToFlags(kw map[string]bool) models.Flags { f |= models.AnsweredFlag case "$flagged": f |= models.FlaggedFlag + case "$draft": + f |= models.DraftFlag } } } |