dovecot-2.2: Replaced mail_get_real_mail() callers with mail_get...

dovecot at dovecot.org dovecot at dovecot.org
Tue Apr 15 15:20:50 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/13ead8c6aed5
changeset: 17213:13ead8c6aed5
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 15 17:08:34 2014 +0200
description:
Replaced mail_get_real_mail() callers with mail_get_backend_mail()

diffstat:

 src/imap/imap-fetch.c                          |  7 +++++--
 src/plugins/lazy-expunge/lazy-expunge-plugin.c |  7 ++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r e47b3e215dec -r 13ead8c6aed5 src/imap/imap-fetch.c
--- a/src/imap/imap-fetch.c	Tue Apr 15 17:06:57 2014 +0200
+++ b/src/imap/imap-fetch.c	Tue Apr 15 17:08:34 2014 +0200
@@ -879,8 +879,11 @@
 static int fetch_x_real_uid(struct imap_fetch_context *ctx, struct mail *mail,
 			    void *context ATTR_UNUSED)
 {
-	str_printfa(ctx->state.cur_str, "X-REAL-UID %u ",
-		    mail_get_real_mail(mail)->uid);
+	struct mail *real_mail;
+
+	if (mail_get_backend_mail(mail, &real_mail) < 0)
+		return -1;
+	str_printfa(ctx->state.cur_str, "X-REAL-UID %u ", real_mail->uid);
 	return 1;
 }
 
diff -r e47b3e215dec -r 13ead8c6aed5 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Tue Apr 15 17:06:57 2014 +0200
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Tue Apr 15 17:08:34 2014 +0200
@@ -200,13 +200,18 @@
 		LAZY_EXPUNGE_CONTEXT(_mail->transaction);
 	struct lazy_expunge_mailbox_list *llist;
 	struct mailbox *real_box;
+	struct mail *real_mail;
 	struct mail_save_context *save_ctx;
 	const char *error;
 	int ret;
 
 	/* don't copy the mail if we're expunging from lazy_expunge
 	   namespace (even if it's via a virtual mailbox) */
-	real_box = mail_get_real_mail(_mail)->box;
+	if (mail_get_backend_mail(_mail, &real_mail) < 0) {
+		lt->failed = TRUE;
+		return;
+	}
+	real_box = real_mail->box;
 	llist = LAZY_EXPUNGE_LIST_CONTEXT(real_box->list);
 	if (llist != NULL && llist->internal_namespace) {
 		mmail->super.expunge(_mail);


More information about the dovecot-cvs mailing list