diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-03-10 23:45:00 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-10 23:45:00 -0400 |
commit | b3896476a0e6978c0d7f6fedfb64588934a78f1e (patch) | |
tree | 735e92c3ecb2955ab53cb3f77f0c676fcd64f1a0 /worker/imap/worker.go | |
parent | 289e3b09ea20e911071e5a0f274445429502e934 (diff) | |
download | aerc-b3896476a0e6978c0d7f6fedfb64588934a78f1e.tar.gz |
Fetch valid UIDs from server after opening dir
Diffstat (limited to 'worker/imap/worker.go')
-rw-r--r-- | worker/imap/worker.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go index f6685c1..51cb221 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -29,9 +29,10 @@ type IMAPWorker struct { user *url.Userinfo } - worker *types.Worker - client *imapClient - updates chan client.Update + client *imapClient + selected imap.MailboxStatus + updates chan client.Update + worker *types.Worker } func NewIMAPWorker(worker *types.Worker) *IMAPWorker { @@ -151,6 +152,8 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { w.handleListDirectories(msg) case *types.OpenDirectory: w.handleOpenDirectory(msg) + case *types.FetchDirectoryContents: + w.handleFetchDirectoryContents(msg) default: return errUnsupported } @@ -162,6 +165,9 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) { switch update := update.(type) { case *client.MailboxUpdate: status := update.Mailbox + if w.selected.Name == status.Name { + w.selected = *status + } w.worker.PostMessage(&types.DirectoryInfo{ Flags: status.Flags, Name: status.Name, |