changeset 12545:9507a067233b

lib-storage: Moved mailbox.save_is_attachment() to mail_save_context.part_is_attachment()
author Timo Sirainen <tss@iki.fi>
date Mon, 06 Dec 2010 03:58:17 +0000
parents dc3b59b71fca
children ab30580b88d9
files src/lib-storage/index/cydir/cydir-storage.c src/lib-storage/index/dbox-multi/mdbox-storage.c src/lib-storage/index/dbox-single/sdbox-storage.c src/lib-storage/index/index-attachment.c src/lib-storage/index/maildir/maildir-storage.c src/lib-storage/index/mbox/mbox-storage.c src/lib-storage/index/raw/raw-storage.c src/lib-storage/mail-storage-private.h src/lib-storage/test-mailbox.c src/plugins/virtual/virtual-storage.c
diffstat 10 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/cydir/cydir-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/cydir/cydir-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -167,7 +167,6 @@
 		cydir_save_finish,
 		cydir_save_cancel,
 		mail_storage_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/index/dbox-multi/mdbox-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -426,7 +426,6 @@
 		mdbox_save_finish,
 		mdbox_save_cancel,
 		mdbox_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/index/dbox-single/sdbox-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/dbox-single/sdbox-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -393,7 +393,6 @@
 		sdbox_save_finish,
 		sdbox_save_cancel,
 		sdbox_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/index/index-attachment.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/index-attachment.c	Mon Dec 06 03:58:17 2010 +0000
@@ -147,7 +147,6 @@
 static bool save_is_attachment(struct mail_save_context *ctx,
 			       struct message_part *part)
 {
-	struct mailbox *box = ctx->transaction->box;
 	struct mail_attachment_part apart;
 
 	if ((part->flags & MESSAGE_PART_FLAG_MULTIPART) != 0) {
@@ -155,14 +154,14 @@
 		   but they're never themselves */
 		return FALSE;
 	}
-	if (box->v.save_is_attachment == NULL)
+	if (ctx->part_is_attachment == NULL)
 		return TRUE;
 
 	memset(&apart, 0, sizeof(apart));
 	apart.part = part;
 	apart.content_type = ctx->attach->part.content_type;
 	apart.content_disposition = ctx->attach->part.content_disposition;
-	return box->v.save_is_attachment(ctx, &apart);
+	return ctx->part_is_attachment(ctx, &apart);
 }
 
 static int index_attachment_save_temp_open_fd(struct mail_storage *storage)
--- a/src/lib-storage/index/maildir/maildir-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -667,7 +667,6 @@
 		maildir_save_finish,
 		maildir_save_cancel,
 		maildir_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/index/mbox/mbox-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -771,7 +771,6 @@
 		mbox_save_finish,
 		mbox_save_cancel,
 		mail_storage_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/index/raw/raw-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/index/raw/raw-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -167,7 +167,6 @@
 		NULL,
 		NULL,
 		mail_storage_copy,
-		NULL,
 		index_storage_is_inconsistent
 	}
 };
--- a/src/lib-storage/mail-storage-private.h	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/mail-storage-private.h	Mon Dec 06 03:58:17 2010 +0000
@@ -175,9 +175,6 @@
 	int (*save_finish)(struct mail_save_context *ctx);
 	void (*save_cancel)(struct mail_save_context *ctx);
 	int (*copy)(struct mail_save_context *ctx, struct mail *mail);
-	/* returns TRUE if message part is an attachment. */
-	bool (*save_is_attachment)(struct mail_save_context *ctx,
-				   const struct mail_attachment_part *part);
 
 	bool (*is_inconsistent)(struct mailbox *box);
 };
@@ -411,6 +408,10 @@
 
 	struct mail_save_attachment *attach;
 
+	/* returns TRUE if message part is an attachment. */
+	bool (*part_is_attachment)(struct mail_save_context *ctx,
+				   const struct mail_attachment_part *part);
+
 	/* we came here from mailbox_copy() */
 	unsigned int copying:1;
 };
--- a/src/lib-storage/test-mailbox.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/lib-storage/test-mailbox.c	Mon Dec 06 03:58:17 2010 +0000
@@ -259,7 +259,6 @@
 		test_mailbox_save_finish,
 		test_mailbox_save_cancel,
 		test_mailbox_copy,
-		NULL,
 		test_mailbox_is_inconsistent
 	}
 };
--- a/src/plugins/virtual/virtual-storage.c	Mon Dec 06 03:53:30 2010 +0000
+++ b/src/plugins/virtual/virtual-storage.c	Mon Dec 06 03:58:17 2010 +0000
@@ -540,7 +540,6 @@
 		virtual_save_finish,
 		virtual_save_cancel,
 		mail_storage_copy,
-		NULL,
 		virtual_is_inconsistent
 	}
 };