summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-13 20:16:55 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-13 20:16:55 -0400
commit026e8a17ca40955652949584388b38566fef66e7 (patch)
treea6430ec16308dc35ddeb1bc7f381a27124427739 /lib
parentbb46b2b7e15ba839475973ae44d5a833c6f2b265 (diff)
downloadaerc-026e8a17ca40955652949584388b38566fef66e7.tar.gz
Handle incoming emails gracefully
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index b39d0bb..fb13346 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -1,6 +1,7 @@
 package lib
 
 import (
+	"fmt"
 	"io"
 	"sync"
 	"time"
@@ -140,6 +141,11 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
 	switch msg := msg.(type) {
 	case *types.DirectoryInfo:
 		store.DirInfo = *msg
+		fmt.Printf("got dirinfo, %d exists, %d known\n",
+			store.DirInfo.Exists, len(store.Uids))
+		if store.DirInfo.Exists != len(store.Uids) {
+			store.worker.PostAction(&types.FetchDirectoryContents{}, nil)
+		}
 		update = true
 	case *types.DirectoryContents:
 		newMap := make(map[uint32]*types.MessageInfo)