about summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
authorWagner Riffel <wgrriffel@gmail.com>2019-08-22 09:53:27 -0300
committerDrew DeVault <sir@cmpwn.com>2019-08-26 09:54:57 +0900
commit90453b5db4a187b47756029615b012f165dc3ef3 (patch)
treeed0ca33ca101611cd44afa9f545f790c148e8d8b /worker
parentecd803aae4ea1ba23d291325d52a53c19216e64b (diff)
downloadaerc-90453b5db4a187b47756029615b012f165dc3ef3.tar.gz
imap worker: do not copy mailbox status mutex
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/worker.go5
1 files 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{