about summary refs log tree commit diff stats
path: root/ui/types.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-11 09:04:18 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-11 09:04:18 -0500
commit4074445cbb45dc6ec132e67b7eac9f32dcfd53de (patch)
treeabb2348df84e12f0a781a4e0d29509962d01c756 /ui/types.go
parentffba56133406027a6a740f9f4454b27134143f0a (diff)
downloadaerc-4074445cbb45dc6ec132e67b7eac9f32dcfd53de.tar.gz
Move worker into account tab
Diffstat (limited to 'ui/types.go')
-rw-r--r--ui/types.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/types.go b/ui/types.go
index 14a91c3..5437642 100644
--- a/ui/types.go
+++ b/ui/types.go
@@ -4,20 +4,19 @@ import (
 	tb "github.com/nsf/termbox-go"
 
 	"git.sr.ht/~sircmpwn/aerc2/config"
+	"git.sr.ht/~sircmpwn/aerc2/worker/types"
 )
 
 const (
 	Valid             = 0
 	InvalidateTabList = 1 << iota
 	InvalidateTabView
-	InvalidateSidebar
 	InvalidateStatusBar
 )
 
 const (
 	InvalidateAll = InvalidateTabList |
 		InvalidateTabView |
-		InvalidateSidebar |
 		InvalidateStatusBar
 )
 
@@ -34,6 +33,16 @@ type AercTab interface {
 	SetParent(parent *UIState)
 }
 
+type WorkerListener interface {
+	GetChannel() chan types.WorkerMessage
+	HandleMessage(msg types.WorkerMessage)
+}
+
+type wrappedMessage struct {
+	msg      types.WorkerMessage
+	listener WorkerListener
+}
+
 type UIState struct {
 	Config       *config.AercConfig
 	Exit         bool
@@ -57,4 +66,6 @@ type UIState struct {
 	}
 
 	tbEvents chan tb.Event
+	// Aggregate channel for all worker messages
+	workerEvents chan wrappedMessage
 }