summaryrefslogtreecommitdiff
path: root/lib/msgstore.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 817a7b3..0ded01f 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -43,6 +43,7 @@ type MessageStore struct {
// Map of uids we've asked the worker to fetch
onUpdate func(store *MessageStore) // TODO: multiple onUpdate handlers
+ onFilterChange func(store *MessageStore)
onUpdateDirs func()
pendingBodies map[uint32]interface{}
pendingHeaders map[uint32]interface{}
@@ -323,6 +324,10 @@ func (store *MessageStore) OnUpdate(fn func(store *MessageStore)) {
store.onUpdate = fn
}
+func (store *MessageStore) OnFilterChange(fn func(store *MessageStore)) {
+ store.onFilterChange = fn
+}
+
func (store *MessageStore) OnUpdateDirs(fn func()) {
store.onUpdateDirs = fn
}
@@ -655,6 +660,9 @@ func (store *MessageStore) ApplyFilter(results []uint32) {
store.results = nil
store.filtered = results
store.filter = true
+ if store.onFilterChange != nil {
+ store.onFilterChange(store)
+ }
store.update()
// any marking is now invalid
// TODO: could save that probably
@@ -668,6 +676,9 @@ func (store *MessageStore) ApplyClear() {
if store.BuildThreads() {
store.runThreadBuilder()
}
+ if store.onFilterChange != nil {
+ store.onFilterChange(store)
+ }
}
func (store *MessageStore) nextPrevResult(delta int) {