aboutsummaryrefslogtreecommitdiffstats
path: root/lib/msgstore.go
diff options
context:
space:
mode:
authorAndrew Jeffery <dev@jeffas.io>2020-07-09 08:46:45 +0100
committerReto Brunner <reto@labrat.space>2020-07-10 09:15:11 +0200
commit6401b105cb28f03b60f03524c0050983e89bdf7a (patch)
treebd6569b3246c448960adbe0a822ba1b1ced9228e /lib/msgstore.go
parent749dbb93a4af2dc3afdda4c9fe8a300b43a69d0f (diff)
downloadaerc-6401b105cb28f03b60f03524c0050983e89bdf7a.tar.gz
Remove deleted messages from search/filter results
This ensures that when moving/deleting messages with a filter active the view gets updated properly.
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index dda15d3b..d823fa5d 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -248,6 +248,15 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
}
}
store.uids = uids
+
+ var newResults []uint32
+ for _, res := range store.results {
+ if _, deleted := toDelete[res]; !deleted {
+ newResults = append(newResults, res)
+ }
+ }
+ store.results = newResults
+
update = true
}