summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/worker.go9
-rw-r--r--worker/types/messages.go2
-rw-r--r--worker/worker.go2
3 files changed, 4 insertions, 9 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index 14e4004..080927d 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -18,13 +18,8 @@ func NewIMAPWorker() *IMAPWorker {
 	}
 }
 
-func (w *IMAPWorker) GetMessage() types.WorkerMessage {
-	select {
-	case msg := <-w.messages:
-		return msg
-	default:
-		return nil
-	}
+func (w *IMAPWorker) GetMessages() chan types.WorkerMessage {
+	return w.messages
 }
 
 func (w *IMAPWorker) PostAction(msg types.WorkerMessage) {
diff --git a/worker/types/messages.go b/worker/types/messages.go
index 845bb86..a4d8ddb 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -33,7 +33,7 @@ type Ping struct {
 
 type Configure struct {
 	Message
-	Config config.AccountConfig
+	Config *config.AccountConfig
 }
 
 type Connect struct {
diff --git a/worker/worker.go b/worker/worker.go
index da7928e..c8ec622 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -9,7 +9,7 @@ import (
 )
 
 type Worker interface {
-	GetMessage() types.WorkerMessage
+	GetMessages() chan types.WorkerMessage
 	PostAction(types.WorkerMessage)
 	Run()
 }