comparison src/lib-storage/index/index-fetch.c @ 47:306c20092a96 HEAD

Errors in user-specified messagesets are now properly reported back to user.
author Timo Sirainen <tss@iki.fi>
date Tue, 27 Aug 2002 06:33:10 +0300
parents 55e09f36d23d
children d493b9cc265e
comparison
equal deleted inserted replaced
46:b2bc8d2e56ff 47:306c20092a96
339 ctx.update_seen = TRUE; 339 ctx.update_seen = TRUE;
340 break; 340 break;
341 } 341 }
342 } 342 }
343 343
344 if (fetch_data->uidset) { 344 ret = index_messageset_foreach(ibox, fetch_data->messageset,
345 ret = mail_index_uidset_foreach(ibox->index, 345 fetch_data->uidset,
346 fetch_data->messageset, 346 index_fetch_mail, &ctx);
347 ibox->synced_messages_count,
348 index_fetch_mail, &ctx);
349 } else {
350 ret = mail_index_messageset_foreach(ibox->index,
351 fetch_data->messageset,
352 ibox->synced_messages_count,
353 index_fetch_mail, &ctx);
354 }
355 347
356 /* close open message files in cache, they're reopened at next fetch 348 /* close open message files in cache, they're reopened at next fetch
357 anyway, and especially with mbox the old data may not be valid 349 anyway, and especially with mbox the old data may not be valid
358 then */ 350 then */
359 imap_msgcache_close(ibox->cache); 351 imap_msgcache_close(ibox->cache);
360 352
361 flags_file_list_unref(ibox->flagsfile); 353 flags_file_list_unref(ibox->flagsfile);
362 354
363 if (!ibox->index->set_lock(ibox->index, MAIL_LOCK_UNLOCK) || ret == -1) 355 if (!ibox->index->set_lock(ibox->index, MAIL_LOCK_UNLOCK))
364 return mail_storage_set_index_error(ibox); 356 return mail_storage_set_index_error(ibox);
365 357
366 if (all_found != NULL) 358 if (all_found != NULL)
367 *all_found = ret == 1; 359 *all_found = ret == 1;
368 360
375 MAIL_SEEN, NULL, MODIFY_ADD, 367 MAIL_SEEN, NULL, MODIFY_ADD,
376 NULL, NULL, NULL)) 368 NULL, NULL, NULL))
377 return FALSE; 369 return FALSE;
378 } 370 }
379 371
380 return TRUE; 372 return ret >= 0;
381 } 373 }