From bd4df530095ee343778a59120a9e641c01010b0f Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 15 Feb 2020 14:14:42 +0100 Subject: Only fetch the directory contents when we are switching directories Previously, sending a DirectoryInfo assumed that a directory change happened. However we don't want that if we only want to update the unread message count. --- lib/msgstore.go | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib') diff --git a/lib/msgstore.go b/lib/msgstore.go index 7209316..e6ddf72 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -31,8 +31,6 @@ 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() @@ -46,7 +44,6 @@ type MessageStore struct { func NewMessageStore(worker *types.Worker, dirInfo *models.DirectoryInfo, - defaultSortCriteria []*types.SortCriterion, triggerNewEmail func(*models.MessageInfo), triggerDirectoryChange func()) *MessageStore { @@ -60,8 +57,6 @@ 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, @@ -176,9 +171,6 @@ 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) -- cgit 1.4.1-2-gfad0 9b8af357d3b9baf6ea'>diff stats
path: root/update_github_page
blob: 5573bf4d54a420fefd9023bb55bbb318ed3df19b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11