about summary refs log tree commit diff stats
path: root/lib/msgstore.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-02-19 08:37:20 +0100
committerReto Brunner <reto@labrat.space>2020-02-19 08:37:20 +0100
commitd44bdc9fb99463081fa622589f7432191dd8b30d (patch)
tree969cc47ed46cda3ec7437544cd0d67069efdae21 /lib/msgstore.go
parentbcab8de07272699e218bafb1c37c1871f3640336 (diff)
downloadaerc-d44bdc9fb99463081fa622589f7432191dd8b30d.tar.gz
Revert "Only fetch the directory contents when we are switching directories"
This reverts commit bd4df530095ee343778a59120a9e641c01010b0f.

I did not properly untangle the opening / dirlist update of each other.
This interferes with the imap worker, hence the revert
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 737ba4d..ae58aaf 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -31,6 +31,8 @@ type MessageStore struct {
 	resultIndex int
 	filter      bool
 
+	defaultSortCriteria []*types.SortCriterion
+
 	// Map of uids we've asked the worker to fetch
 	onUpdate       func(store *MessageStore) // TODO: multiple onUpdate handlers
 	onUpdateDirs   func()
@@ -44,6 +46,7 @@ type MessageStore struct {
 
 func NewMessageStore(worker *types.Worker,
 	dirInfo *models.DirectoryInfo,
+	defaultSortCriteria []*types.SortCriterion,
 	triggerNewEmail func(*models.MessageInfo),
 	triggerDirectoryChange func()) *MessageStore {
 
@@ -57,6 +60,8 @@ func NewMessageStore(worker *types.Worker,
 		bodyCallbacks:   make(map[uint32][]func(io.Reader)),
 		headerCallbacks: make(map[uint32][]func(*types.MessageInfo)),
 
+		defaultSortCriteria: defaultSortCriteria,
+
 		pendingBodies:  make(map[uint32]interface{}),
 		pendingHeaders: make(map[uint32]interface{}),
 		worker:         worker,
@@ -172,6 +177,9 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
 	switch msg := msg.(type) {
 	case *types.DirectoryInfo:
 		store.DirInfo = *msg.Info
+		store.worker.PostAction(&types.FetchDirectoryContents{
+			SortCriteria: store.defaultSortCriteria,
+		}, nil)
 		update = true
 	case *types.DirectoryContents:
 		newMap := make(map[uint32]*models.MessageInfo)
a title='author hut <hut@lavabit.com> 2010-01-01 04:22:32 +0100 committer hut <hut@lavabit.com> 2010-01-01 04:22:32 +0100 improved procedures of spawning processes' href='/akspecs/ranger/commit/TODO?h=v1.9.0b3&id=23236d0cfd081305a8fd93428ab842d7814df380'>23236d0c ^
08f21ae5 ^
4b826595 ^
757e1f55 ^
277ecc9e ^
9983328c ^
33cb688a ^
a1274aba ^
b42eb058 ^
b13518af ^
316ff5a9 ^
fc486c60 ^
b4934e42 ^
2c1d2db0 ^
291ca616 ^
50845f37 ^
039c03ef ^
af6658b3 ^
efe2d7a3 ^
f0df3fa5 ^
a986e2bd ^

3fe38754 ^

6a8d5d23 ^
aad61455 ^
7a268c8b ^

efdc7b16 ^
1f62d7db ^
c776804d ^
4be8b401 ^



d955e3f0 ^
75013dc7 ^
67bb838c ^
a808a661 ^
bba8d293 ^
2a64495f ^
5e449699 ^
fc486c60 ^
c5450bd1 ^
7b04e507 ^
87db0130 ^
dd4a4145 ^
8f2f1767 ^
db1721dd ^
aea5cf92 ^
b624bd94 ^
69d1220f ^
6099d9a3 ^
9207e83c ^
c776804d ^
6099d9a3 ^
6f43de0a ^




fca1fc4f ^
f70ee6b2 ^
0db4c9b2 ^
b2d63ef5 ^
291ca616 ^
d994d0d6 ^
01c89bb5 ^
c776804d ^
66c5bb93 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90