From 90453b5db4a187b47756029615b012f165dc3ef3 Mon Sep 17 00:00:00 2001 From: Wagner Riffel Date: Thu, 22 Aug 2019 09:53:27 -0300 Subject: [PATCH] imap worker: do not copy mailbox status mutex Signed-off-by: Wagner Riffel --- worker/imap/worker.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 1341167..cd63c39 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -42,7 +42,7 @@ type IMAPWorker struct { client *imapClient idleStop chan struct{} idleDone chan error - selected imap.MailboxStatus + selected *imap.MailboxStatus updates chan client.Update worker *types.Worker // Map of sequence numbers to UIDs, index 0 is seq number 1 @@ -54,6 +54,7 @@ func NewIMAPWorker(worker *types.Worker) (types.Backend, error) { idleDone: make(chan error), updates: make(chan client.Update, 50), worker: worker, + selected: &imap.MailboxStatus{}, }, nil } @@ -196,7 +197,7 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) { case *client.MailboxUpdate: status := update.Mailbox if w.selected.Name == status.Name { - w.selected = *status + w.selected = status } w.worker.PostMessage(&types.DirectoryInfo{ Info: &models.DirectoryInfo{