Hi Aaron and all,
Here comes the patch with the -ru options enabled.
Cheers,
Tilman
On Sun, Feb 02, 2014 at 09:22:50AM -0500, Aaron Schrab wrote:
> At 22:27 +0100 01 Feb 2014, Tilman WEIERS <[email protected]> wrote:
> >Nearly a month passed since my last message. Here comes the patch
> >that I announced some time ago.
> >
> >The patch introduces imap_partial_fetch into mutt. To try it out, add the
> >line
> >set imap_partial_fetch=yes
> >to your .muttrc file.
> >
> >The code introduced here will at least partly resolve the issue related
> >to imap partial fetch. I often get emails which a 3.6k text part and
> >with 22 M of images. The proposed change will as a minimum allow users
> >to check the text of a message before downloading 22M of images.
>
> Sounds good, but since you seem to not be using version control, you'll need
> to use the `diff -u` option to produce a patch that will really be useful.
> If that option (or `-c`) isn't used, the patch that is produced can only be
> applied to the exact version of the file that you used as a starting point
> and is almost completely unreadable.
>
> >diff -r muttsrc/commands.c mycleanmutt/commands.c
> >72c72
--- muttsrc/commands.c 2014-02-01 21:48:14.425507687 +0100
+++ mycleanmutt/commands.c 2014-02-01 22:03:15.666597898 +0100
@@ -69,7 +69,7 @@
snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content),
cur->content->subtype);
- mutt_parse_mime_message (Context, cur);
+ mutt_parse_mime_message (Context, cur, option (OPTIMAPPARTIALFETCH) ? 1 : 0);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
/* see if crypto is needed for this message. if so, we should exit curses */
@@ -370,7 +370,7 @@
}
if (decode)
- mutt_parse_mime_message (Context, h);
+ mutt_parse_mime_message (Context, h, option (OPTIMAPPARTIALFETCH) ? 1 : 0);
mutt_copy_message (fp, Context, h, cmflags, chflags);
}
@@ -402,7 +402,7 @@
if (WithCrypto && decode)
{
- mutt_parse_mime_message (Context, h);
+ mutt_parse_mime_message (Context, h, option (OPTIMAPPARTIALFETCH) ? 1 :
0);
if(h->security & ENCRYPT && !crypt_valid_passphrase(h->security))
return 1;
}
@@ -427,7 +427,7 @@
if(Context->hdrs[Context->v2r[i]]->tagged)
{
mutt_message_hook (Context, Context->hdrs[Context->v2r[i]],
M_MESSAGEHOOK);
- mutt_parse_mime_message(Context, Context->hdrs[Context->v2r[i]]);
+ mutt_parse_mime_message(Context, Context->hdrs[Context->v2r[i]],
option (OPTIMAPPARTIALFETCH) ? 1 : 0);
if (Context->hdrs[Context->v2r[i]]->security & ENCRYPT &&
!crypt_valid_passphrase(Context->hdrs[Context->v2r[i]]->security))
return 1;
@@ -709,7 +709,7 @@
set_copy_flags (h, decode, decrypt, &cmflags, &chflags);
if (decode || decrypt)
- mutt_parse_mime_message (Context, h);
+ mutt_parse_mime_message (Context, h, option (OPTIMAPPARTIALFETCH) ? 1 : 0);
if ((rc = mutt_append_message (ctx, Context, h, cmflags, chflags)) != 0)
return rc;
@@ -979,11 +979,11 @@
{
MESSAGE *msg;
int rv = 0;
-
+
h->security |= PGP_TRADITIONAL_CHECKED;
- mutt_parse_mime_message (Context, h);
- if ((msg = mx_open_message (Context, h->msgno)) == NULL)
+ mutt_parse_mime_message (Context, h, option (OPTIMAPPARTIALFETCH) ? 1 : 0);
+ if ((msg = mx_open_message (Context, h->msgno, 0)) == NULL)
return 0;
if (crypt_pgp_check_traditional (msg->fp, h->content, 0))
{