]> granicus.if.org Git - neomutt/commitdiff
fix corrupt viewing of messages
authorKarel Zak <kzak@redhat.com>
Mon, 17 Sep 2012 07:31:54 +0000 (09:31 +0200)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:07 +0000 (16:30 +0100)
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 <kzak@redhat.com>
mutt_notmuch.c

index 916777a4cea6b702f30fdba34d32e26e9077da5a..d4142dcee5ff30f46ad96a80df844b5356770dc1 100644 (file)
@@ -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)