summaryrefslogtreecommitdiffstats
path: root/copy.c
diff options
context:
space:
mode:
authorDavid Champion <dgc@bikeshed.us>2017-01-28 18:47:15 -0800
committerDavid Champion <dgc@bikeshed.us>2017-01-28 18:47:15 -0800
commit8583edba96dc050315dba9bfa9dcad17996f2d9a (patch)
tree3fbd638ee46d8a23166615fe7728eaa6768e6d4f /copy.c
parent7989acf60ca1e6430571c63d11fa19d4d31372fc (diff)
Adds capability to edit x-labels inside mutt, and to sort by label.
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/copy.c b/copy.c
index 1ef441f4..3ba0bad0 100644
--- a/copy.c
+++ b/copy.c
@@ -111,6 +111,10 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
ignore = 0;
}
+ if (flags & CH_UPDATE_LABEL &&
+ mutt_strncasecmp ("X-Label:", buf, 8) == 0)
+ continue;
+
if (!ignore && fputs (buf, out) == EOF)
return (-1);
}
@@ -414,6 +418,15 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
fprintf (out, "Lines: %d\n", h->lines);
}
+ if (flags & CH_UPDATE_LABEL && h->xlabel_changed)
+ {
+ h->xlabel_changed = 0;
+ if (h->env->x_label != NULL)
+ if (fprintf(out, "X-Label: %s\n", h->env->x_label) !=
+ 10 + strlen(h->env->x_label))
+ return -1;
+ }
+
if ((flags & CH_NONEWLINE) == 0)
{
if (flags & CH_PREFIX)
@@ -494,6 +507,9 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
_mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, hdr, 0);
}
+ if (hdr->xlabel_changed)
+ chflags |= CH_UPDATE_LABEL;
+
if ((flags & MUTT_CM_NOHEADER) == 0)
{
if (flags & MUTT_CM_PREFIX)