Changeset 2069:ca45605ed6eb for buffy.c

Show
Ignore:
Timestamp:
2000-08-21 08:42:19 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

patch-bac.createplus-1

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • buffy.c

    r1601 r2069  
    231231  struct stat contex_sb; 
    232232  time_t t; 
    233 #ifdef USE_IMAP 
    234   static time_t last_imap_check = 0; 
    235   int do_imap_check = 1; 
    236  
    237   if (ImapCheckTimeout) 
    238   { 
    239     time_t now = time (NULL); 
    240     if (now - last_imap_check < ImapCheckTimeout) 
    241       do_imap_check = 0; 
    242     else 
    243       last_imap_check = now; 
    244   } 
    245  
     233 
     234#ifdef USE_IMAP 
    246235  /* update postponed count as well, on force */ 
    247236  if (force) 
    248237    mutt_update_num_postponed (); 
    249  
    250238#endif 
    251239 
     
    273261  for (tmp = Incoming; tmp; tmp = tmp->next) 
    274262  { 
     263    tmp->new = 0; 
     264 
    275265#ifdef USE_IMAP 
    276266    if ((tmp->magic == M_IMAP) || mx_is_imap (tmp->path)) 
     
    278268    else 
    279269#endif 
    280     { 
    281       tmp->new = 0; 
    282        
    283       if (stat (tmp->path, &sb) != 0 || sb.st_size == 0 || 
    284           (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0)) 
    285       { 
    286         /* if the mailbox still doesn't exist, set the newly created flag to 
    287          * be ready for when it does. 
    288          */ 
    289         tmp->newly_created = 1; 
    290         tmp->magic = 0; 
    291 #ifdef BUFFY_SIZE 
    292         tmp->size = 0; 
    293 #endif 
    294         continue; 
    295       } 
     270    if (stat (tmp->path, &sb) != 0 || sb.st_size == 0 || 
     271        (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0)) 
     272    { 
     273      /* if the mailbox still doesn't exist, set the newly created flag to 
     274       * be ready for when it does. */ 
     275      tmp->newly_created = 1; 
     276      tmp->magic = 0; 
     277#ifdef BUFFY_SIZE 
     278      tmp->size = 0; 
     279#endif 
     280      continue; 
    296281    } 
    297282 
     
    300285    if (!Context || !Context->path ||  
    301286#ifdef USE_IMAP 
    302         /* unless folder is an IMAP folder */ 
    303         tmp->magic == M_IMAP || 
     287        (tmp->magic == M_IMAP && mutt_strcmp (tmp->path, Context->path)) || 
     288        (tmp->magic != M_IMAP && ( 
    304289#endif 
    305290        sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino) 
     291#ifdef USE_IMAP 
     292          )) 
     293#endif 
    306294    { 
    307295      switch (tmp->magic) 
     
    356344#ifdef USE_IMAP 
    357345      case M_IMAP: 
    358         /* poll on do_imap_check, else return cached value. 
    359          * If the check is forced (eg on mailbox open), check only current 
    360          * folder */ 
    361         if (do_imap_check || (force && Context && Context->path && 
    362           !mutt_strcmp (Context->path, tmp->path))) 
    363         { 
    364           tmp->new = 0; 
    365           if (imap_mailbox_check (tmp->path, 1) > 0) 
    366           { 
    367             BuffyCount++; 
    368             tmp->new = 1; 
    369           } 
    370         } 
    371         else 
    372           if (tmp->new) 
    373             BuffyCount++; 
     346        if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) 
     347          BuffyCount++; 
     348        else 
     349          tmp->new = 0; 
    374350 
    375351        break;