From dbdd1c46b693deb2e9376ba2555ae2fe810b477b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 17 Sep 2012 09:31:54 +0200 Subject: [PATCH] fix corrupt viewing of messages The mutt records offset of email body when parse email header. Unfortunately when we check notmuch DB changes when we don't ask for email path in the same way. So it's possible that for emails that are stored in multiple folders (you sent the same email with the same ID to multiple mailing lists) we get a different path, then notmuch mutt code updates the path, but no the offset... result is corrupted body. Signed-off-by: Karel Zak --- mutt_notmuch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 916777a4c..d4142dcee 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -758,9 +758,10 @@ static void append_message(CONTEXT *ctx, notmuch_message_t *msg) if (!path) return; - dprint(2, (debugfile, "nm: appending message, i=%d, (%s)\n", + dprint(2, (debugfile, "nm: appending message, i=%d, id=%s, path=%s\n", ctx->msgcount, - notmuch_message_get_message_id(msg))); + notmuch_message_get_message_id(msg), + path)); if (ctx->msgcount >= ctx->hdrmax) { dprint(2, (debugfile, "nm: allocate mx memory\n")); @@ -1524,7 +1525,7 @@ int nm_check_database(CONTEXT *ctx, int *index_hint) /* check to see if the message has moved to a different * subdirectory. If so, update the associated filename. */ - new = notmuch_message_get_filename(m); + new = get_message_last_filename(m); nm_header_get_fullpath(h, old, sizeof(old)); if (mutt_strcmp(old, new) != 0) -- 2.50.1