about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index e6ddf72..737ba4d 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -168,6 +168,7 @@ func merge(to *models.MessageInfo, from *models.MessageInfo) {
 func (store *MessageStore) Update(msg types.WorkerMessage) {
 	update := false
 	directoryChange := false
+	requestDirInfo := false
 	switch msg := msg.(type) {
 	case *types.DirectoryInfo:
 		store.DirInfo = *msg.Info
@@ -212,6 +213,7 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
 			}
 		}
 		update = true
+		requestDirInfo = true
 	case *types.FullMessage:
 		if _, ok := store.pendingBodies[msg.Content.Uid]; ok {
 			delete(store.pendingBodies, msg.Content.Uid)
@@ -245,6 +247,7 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
 		}
 		store.uids = uids
 		update = true
+		requestDirInfo = true
 	}
 
 	if update {
@@ -254,6 +257,12 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
 	if directoryChange && store.triggerDirectoryChange != nil {
 		store.triggerDirectoryChange()
 	}
+
+	if requestDirInfo {
+		store.worker.PostAction(&types.DirectoryInfoUpdateRequest{
+			Name: store.DirInfo.Name,
+		}, nil)
+	}
 }
 
 func (store *MessageStore) OnUpdate(fn func(store *MessageStore)) {