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-15 14:14:42 +0100
committerDrew DeVault <sir@cmpwn.com>2020-02-16 10:41:15 -0500
commitbd4df530095ee343778a59120a9e641c01010b0f (patch)
tree2995671ce6986d39b3389ce7ffad0b15e3a162c3 /lib/msgstore.go
parent30c0a9fba471bcd023c8aeebb3901803bb35d31f (diff)
downloadaerc-bd4df530095ee343778a59120a9e641c01010b0f.tar.gz
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.
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go8
1 files changed, 0 insertions, 8 deletions
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)
id='n202' href='#n202'>202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361