~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to pop.c

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2009-06-17 17:17:28 UTC
  • mfrom: (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20090617171728-61dkl7w5fgn7ybdq
Tags: upstream-1.5.20
Import upstream version 1.5.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
    }
131
131
  }
132
132
 
133
 
  fclose (f);
 
133
  safe_fclose (&f);
134
134
  unlink (tempfile);
135
135
  return ret;
136
136
}
226
226
 */
227
227
static int pop_fetch_headers (CONTEXT *ctx)
228
228
{
229
 
  int i, ret, old_count, new_count;
 
229
  int i, ret, old_count, new_count, deleted;
230
230
  unsigned short hcached = 0, bcached;
231
231
  POP_DATA *pop_data = (POP_DATA *)ctx->data;
232
232
  progress_t progress;
274
274
 
275
275
  if (ret == 0)
276
276
  {
277
 
    for (i = 0; i < old_count; i++)
 
277
    for (i = 0, deleted = 0; i < old_count; i++)
 
278
    {
278
279
      if (ctx->hdrs[i]->refno == -1)
 
280
      {
279
281
        ctx->hdrs[i]->deleted = 1;
 
282
        deleted++;
 
283
      }
 
284
    }
 
285
    if (deleted > 0)
 
286
    {
 
287
      mutt_error (_("%d messages have been lost. Try reopening the mailbox."),
 
288
                  deleted);
 
289
      mutt_sleep (2);
 
290
    }
280
291
 
281
292
    for (i = old_count; i < new_count; i++)
282
293
    {
418
429
  memset (ctx->rights, 0, sizeof (ctx->rights));
419
430
  mutt_bit_set (ctx->rights, M_ACL_SEEN);
420
431
  mutt_bit_set (ctx->rights, M_ACL_DELETE);
 
432
#if USE_HCACHE
 
433
  /* flags are managed using header cache, so it only makes sense to
 
434
   * enable them in that case */
 
435
  mutt_bit_set (ctx->rights, M_ACL_WRITE);
 
436
#endif
421
437
 
422
438
  FOREVER
423
439
  {
652
668
 
653
669
    for (i = 0, j = 0, ret = 0; ret == 0 && i < ctx->msgcount; i++)
654
670
    {
655
 
      if (ctx->hdrs[i]->deleted)
 
671
      if (ctx->hdrs[i]->deleted && ctx->hdrs[i]->refno != -1)
656
672
      {
657
673
        j++;
658
674
        if (!ctx->quiet)
666
682
#endif
667
683
        }
668
684
      }
 
685
 
 
686
#if USE_HCACHE
 
687
      if (ctx->hdrs[i]->changed)
 
688
      {
 
689
        mutt_hcache_store (hc, ctx->hdrs[i]->data, ctx->hdrs[i], 0, strlen);
 
690
      }
 
691
#endif
 
692
 
669
693
    }
670
694
 
671
695
#if USE_HCACHE