comparison src/plugins/lazy-expunge/lazy-expunge-plugin.c @ 6940:414c9d631a81 HEAD

Replaced t_push/t_pop calls with T_FRAME*() macros.
author Timo Sirainen <tss@iki.fi>
date Wed, 05 Dec 2007 17:47:44 +0200
parents 1a3604c8ee05
children 7ed926ed7aa4
comparison
equal deleted inserted replaced
6939:c7b42fea5fcc 6940:414c9d631a81
390 (uint32_t)random()); 390 (uint32_t)random());
391 destdir = mailbox_list_get_path(dest_list, dest_name, 391 destdir = mailbox_list_get_path(dest_list, dest_name,
392 MAILBOX_LIST_PATH_TYPE_MAILBOX); 392 MAILBOX_LIST_PATH_TYPE_MAILBOX);
393 } 393 }
394 394
395 t_push();
396 src2dir = mailbox_list_get_path(src_list, src_name, 395 src2dir = mailbox_list_get_path(src_list, src_name,
397 MAILBOX_LIST_PATH_TYPE_CONTROL); 396 MAILBOX_LIST_PATH_TYPE_CONTROL);
398 if (strcmp(src2dir, srcdir) != 0) { 397 if (strcmp(src2dir, srcdir) != 0) {
399 destdir = mailbox_list_get_path(dest_list, dest_name, 398 destdir = mailbox_list_get_path(dest_list, dest_name,
400 MAILBOX_LIST_PATH_TYPE_CONTROL); 399 MAILBOX_LIST_PATH_TYPE_CONTROL);
405 if (strcmp(src3dir, srcdir) != 0 && strcmp(src3dir, src2dir) != 0) { 404 if (strcmp(src3dir, srcdir) != 0 && strcmp(src3dir, src2dir) != 0) {
406 destdir = mailbox_list_get_path(dest_list, dest_name, 405 destdir = mailbox_list_get_path(dest_list, dest_name,
407 MAILBOX_LIST_PATH_TYPE_INDEX); 406 MAILBOX_LIST_PATH_TYPE_INDEX);
408 (void)dir_move_or_merge(src_list, src3dir, destdir); 407 (void)dir_move_or_merge(src_list, src3dir, destdir);
409 } 408 }
410 t_pop();
411 409
412 *_dest_name = dest_name; 410 *_dest_name = dest_name;
413 return 1; 411 return 1;
414 } 412 }
415 413
489 if (strcmp(storage->name, "maildir") != 0) 487 if (strcmp(storage->name, "maildir") != 0)
490 return; 488 return;
491 489
492 /* if this is one of our internal storages, mark it as such before 490 /* if this is one of our internal storages, mark it as such before
493 quota plugin sees it */ 491 quota plugin sees it */
494 t_push();
495 p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " "); 492 p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " ");
496 for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) { 493 for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) {
497 if (strcmp(storage->ns->prefix, *p) == 0) { 494 if (strcmp(storage->ns->prefix, *p) == 0) {
498 storage->ns->flags |= NAMESPACE_FLAG_INTERNAL; 495 storage->ns->flags |= NAMESPACE_FLAG_INTERNAL;
499 break; 496 break;
500 } 497 }
501 } 498 }
502 t_pop();
503 499
504 llist->storage = storage; 500 llist->storage = storage;
505 501
506 lstorage = p_new(storage->pool, struct lazy_expunge_mail_storage, 1); 502 lstorage = p_new(storage->pool, struct lazy_expunge_mail_storage, 1);
507 lstorage->module_ctx.super = storage->v; 503 lstorage->module_ctx.super = storage->v;
532 int i; 528 int i;
533 529
534 if (lazy_expunge_next_hook_mail_namespaces_created != NULL) 530 if (lazy_expunge_next_hook_mail_namespaces_created != NULL)
535 lazy_expunge_next_hook_mail_namespaces_created(namespaces); 531 lazy_expunge_next_hook_mail_namespaces_created(namespaces);
536 532
537 t_push();
538 p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " "); 533 p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " ");
539 for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) { 534 for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) {
540 const char *name = *p; 535 const char *name = *p;
541 536
542 if (name == NULL) 537 if (name == NULL)
554 /* we don't want to override these namespaces' expunge/delete 549 /* we don't want to override these namespaces' expunge/delete
555 operations. */ 550 operations. */
556 lstorage = LAZY_EXPUNGE_CONTEXT(lazy_namespaces[i]->storage); 551 lstorage = LAZY_EXPUNGE_CONTEXT(lazy_namespaces[i]->storage);
557 lstorage->internal_namespace = TRUE; 552 lstorage->internal_namespace = TRUE;
558 } 553 }
559 t_pop();
560 } 554 }
561 555
562 void lazy_expunge_plugin_init(void) 556 void lazy_expunge_plugin_init(void)
563 { 557 {
564 if (getenv("LAZY_EXPUNGE") == NULL) 558 if (getenv("LAZY_EXPUNGE") == NULL)