Changeset 1024:72cb474edaf3 for buffy.c
- Timestamp:
- 1999-08-30 02:41:10 (9 years ago)
- Branch:
- mutt-1-0-stable
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
buffy.c
r905 r1024 228 228 struct stat contex_sb; 229 229 time_t t; 230 #ifdef USE_IMAP 231 static time_t last_imap_check = 0; 232 int do_imap_check = 1; 233 234 if (ImapCheckTime) 235 { 236 time_t now = time (NULL); 237 if (!force && (now - last_imap_check < ImapCheckTime)) 238 do_imap_check = 0; 239 else 240 last_imap_check = now; 241 } 242 #endif 230 243 231 244 /* fastest return if there are no mailboxes */ … … 240 253 BuffyNotify = 0; 241 254 255 #ifdef USE_IMAP 256 if (!Context || Context->magic != M_IMAP) 257 #endif 242 258 /* check device ID and serial number instead of comparing paths */ 243 259 if (!Context || !Context->path || stat (Context->path, &contex_sb) != 0) … … 249 265 for (tmp = Incoming; tmp; tmp = tmp->next) 250 266 { 251 tmp->new = 0;252 253 267 #ifdef USE_IMAP 254 268 if ((tmp->magic == M_IMAP) || mx_is_imap (tmp->path)) 255 {256 269 tmp->magic = M_IMAP; 257 }258 270 else 259 271 #endif 260 if (stat (tmp->path, &sb) != 0 || 261 (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0)) 262 { 263 /* if the mailbox still doesn't exist, set the newly created flag to 264 * be ready for when it does. 265 */ 266 tmp->newly_created = 1; 267 tmp->magic = 0; 268 #ifdef BUFFY_SIZE 269 tmp->size = 0; 270 #endif 271 continue; 272 { 273 tmp->new = 0; 274 275 if (stat (tmp->path, &sb) != 0 || 276 (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0)) 277 { 278 /* if the mailbox still doesn't exist, set the newly created flag to 279 * be ready for when it does. 280 */ 281 tmp->newly_created = 1; 282 tmp->magic = 0; 283 #ifdef BUFFY_SIZE 284 tmp->size = 0; 285 #endif 286 continue; 287 } 272 288 } 273 289 274 290 if (!Context || !Context->path || 291 #ifdef USE_IMAP 292 /* Poll current IMAP folder like any other */ 293 tmp->magic == M_IMAP || 294 #endif 275 295 sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino) 276 296 { … … 326 346 #ifdef USE_IMAP 327 347 case M_IMAP: 328 if (imap_buffy_check (tmp->path) > 0) 329 { 330 BuffyCount++; 331 tmp->new = 1; 332 } 348 /* poll on do_imap_check, else return cached value */ 349 if (do_imap_check) 350 { 351 tmp->new = 0; 352 if (imap_buffy_check (tmp->path) > 0) 353 { 354 BuffyCount++; 355 tmp->new = 1; 356 } 357 } 358 else 359 if (tmp->new) 360 BuffyCount++; 361 333 362 break; 334 363 #endif
