aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index ccde2c2..bc55255 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -171,6 +171,15 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
case *types.DirectoryInfo:
store.DirInfo = *msg.Info
if store.thread {
+ store.worker.PostAction(&types.FetchNativeThreadSupport{}, nil)
+ } else {
+ store.worker.PostAction(&types.FetchDirectoryContents{
+ SortCriteria: store.defaultSortCriteria,
+ }, nil)
+ }
+ update = true
+ case *types.NativeThreadSupport:
+ if msg.HasSupport {
store.worker.PostAction(&types.FetchDirectoryThreaded{
SortCriteria: store.defaultSortCriteria,
}, nil)
@@ -178,8 +187,8 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
store.worker.PostAction(&types.FetchDirectoryContents{
SortCriteria: store.defaultSortCriteria,
}, nil)
+ update = true
}
- update = true
case *types.DirectoryThreaded:
var (
uids []uint32
@@ -190,7 +199,7 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
msg.ThreadRoot.Traverse(false, func(t *types.Thread) bool {
uid := t.Uid
uids = append([]uint32{uid}, uids...)
- flattened = append([]*types.Thread{t}, flattened...)
+ flattened = append(flattened, t)
if msg, ok := store.Messages[uid]; ok {
newMap[uid] = msg
} else {