Fix broken templates attachments due to commit 814b087,
authorwwp <wwp@free.fr>
Tue, 3 Apr 2018 08:17:58 +0000 (10:17 +0200)
committerwwp <wwp@free.fr>
Tue, 3 Apr 2018 08:17:58 +0000 (10:17 +0200)
which clears template internals (including attachments list)
wherever template contains any field to apply (To/Subject/etc.)
and before attachments could be processed. Simply process
attachments before attachments list may be cleared by fields
processing. Ideally we should change quote_fmt_reset_vartable()
or its uses in compose.c at least.

src/compose.c

index b6b14e7..efb3b9c 100644 (file)
@@ -8847,8 +8847,8 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
 
        /* process the other fields */
 
-       compose_template_apply_fields(compose, tmpl);
        compose_attach_from_list(compose, quote_fmt_get_attachments_list(), FALSE);
+       compose_template_apply_fields(compose, tmpl);
        quote_fmt_reset_vartable();
        quote_fmtlex_destroy();