dovecot-2.0: lib-storage: Changed mailbox.save_is_attachment() API

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 2 14:34:04 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/5adeda44a03f
changeset: 12259:5adeda44a03f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 26 20:03:02 2010 +0100
description:
lib-storage: Changed mailbox.save_is_attachment() API

diffstat:

 src/lib-storage/index/index-attachment.c |  9 +++++++--
 src/lib-storage/mail-storage-private.h   |  7 ++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r 6afec3647628 -r 5adeda44a03f src/lib-storage/index/index-attachment.c
--- a/src/lib-storage/index/index-attachment.c	Thu Aug 26 18:59:19 2010 +0100
+++ b/src/lib-storage/index/index-attachment.c	Thu Aug 26 20:03:02 2010 +0100
@@ -150,6 +150,7 @@
 			       struct message_part *part)
 {
 	struct mailbox *box = ctx->transaction->box;
+	struct mail_attachment_part apart;
 
 	if ((part->flags & MESSAGE_PART_FLAG_MULTIPART) != 0) {
 		/* multiparts may contain attachments as children,
@@ -158,8 +159,12 @@
 	}
 	if (box->v.save_is_attachment == NULL)
 		return TRUE;
-	else
-		return box->v.save_is_attachment(ctx, part);
+
+	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);
 }
 
 static int index_attachment_save_temp_open_fd(struct mail_storage *storage)
diff -r 6afec3647628 -r 5adeda44a03f src/lib-storage/mail-storage-private.h
--- a/src/lib-storage/mail-storage-private.h	Thu Aug 26 18:59:19 2010 +0100
+++ b/src/lib-storage/mail-storage-private.h	Thu Aug 26 20:03:02 2010 +0100
@@ -91,6 +91,11 @@
 	ARRAY_DEFINE(module_contexts, union mail_storage_module_context *);
 };
 
+struct mail_attachment_part {
+	struct message_part *part;
+	const char *content_type, *content_disposition;
+};
+
 struct mailbox_vfuncs {
 	bool (*is_readonly)(struct mailbox *box);
 	bool (*allow_new_keywords)(struct mailbox *box);
@@ -207,7 +212,7 @@
 	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,
-				   struct message_part *part);
+				   const struct mail_attachment_part *part);
 
 	bool (*is_inconsistent)(struct mailbox *box);
 };


More information about the dovecot-cvs mailing list