cur->content->subtype);
mutt_parse_mime_message (Context, cur);
-
+ mutt_message_hook (Context, cur, M_MESSAGEHOOK);
#ifdef HAVE_PGP
/* see if PGP is needed for this message. if so, we should exit curses */
return (0);
}
- mutt_message_hook (cur, M_MESSAGEHOOK);
-
if (DisplayFilter && *DisplayFilter)
{
fpfilterout = fpout;
if (h)
{
-
+ mutt_message_hook (Context, h, M_MESSAGEHOOK);
#ifdef HAVE_PGP
if (option (OPTPIPEDECODE))
for (i = 0; i < Context->vcount; i++)
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]]);
if (Context->hdrs[Context->v2r[i]]->pgp & PGPENCRYPT &&
!pgp_valid_passphrase())
{
if (Context->hdrs[Context->v2r[i]]->tagged)
{
+ mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);
endwin ();
thepid = mutt_create_filter (buffer, &(s.fpout), NULL, NULL);
mutt_pipe_message_to_state (Context->hdrs[Context->v2r[i]], &s);
{
if (Context->hdrs[Context->v2r[i]]->tagged)
{
+ mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);
mutt_pipe_message_to_state (Context->hdrs[Context->v2r[i]], &s);
/* add the message separator */
if (PipeSep)
*redraw = 0;
+
snprintf (prompt, sizeof (prompt), _("%s%s to mailbox"),
decode ? (delete ? _("Decode-save") : _("Decode-copy")) :
(decrypt ? (delete ? _("Decrypt-save") : _("Decrypt-copy")):
#ifdef HAVE_PGP
need_passphrase = h->pgp & PGPENCRYPT;
#endif
+ mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
}
else
if (h)
{
+ mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
#ifdef HAVE_PGP
need_passphrase |= h->pgp & PGPENCRYPT;
for (i = 0; i < Context->vcount; i++)
{
if (Context->hdrs[Context->v2r[i]]->tagged)
+ {
+ mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);
_mutt_save_message(Context->hdrs[Context->v2r[i]],
&ctx, delete, decode, decrypt);
+ }
}
}
pid_t thepid;
FILE *fp;
+
if (query_quadoption (OPT_PRINT,
h ? _("Print message?") : _("Print tagged messages?"))
!= M_YES)
return;
if (h)
{
+ mutt_message_hook (Context, h, M_MESSAGEHOOK);
print_msg (fp, Context, h);
count++;
}
{
if (Context->hdrs[Context->v2r[i]]->tagged)
{
+ mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);
print_msg (fp, Context, Context->hdrs[Context->v2r[i]]);
/* add a formfeed */
fputc ('\f', fp);
if (data & (M_SENDHOOK | M_SAVEHOOK | M_FCCHOOK | M_MESSAGEHOOK))
{
if ((pat = mutt_pattern_comp (pattern.data,
- (data & (M_SENDHOOK | M_FCCHOOK | M_MESSAGEHOOK)) ? 0 : M_FULL_MSG,
+ (data & (M_SENDHOOK | M_FCCHOOK)) ? 0 : M_FULL_MSG,
err)) == NULL)
goto error;
}
return (NULL);
}
-void mutt_message_hook (HEADER *hdr, int type)
+void mutt_message_hook (CONTEXT *ctx, HEADER *hdr, int type)
{
BUFFER err, token;
HOOK *hook;
continue;
if (hook->type & type)
- if ((mutt_pattern_exec (hook->pattern, 0, NULL, hdr) > 0) ^ hook->rx.not)
+ if ((mutt_pattern_exec (hook->pattern, 0, ctx, hdr) > 0) ^ hook->rx.not)
if (mutt_parse_rc_line (hook->command, &token, &err) != 0)
{
FREE (&token.data);
void mutt_select_fcc (char *, size_t, HEADER *);
#define mutt_select_file(A,B,C) _mutt_select_file(A,B,C,0,NULL,NULL)
void _mutt_select_file (char *, size_t, int, int, char ***, int *);
-void mutt_message_hook (HEADER *, int);
+void mutt_message_hook (CONTEXT *, HEADER *, int);
void _mutt_set_flag (CONTEXT *, HEADER *, int, int, int);
#define mutt_set_flag(a,b,c,d) _mutt_set_flag(a,b,c,d,1)
void mutt_set_followup_to (ENVELOPE *);
/* make sure we have parsed this message */
mutt_parse_mime_message (Context, hdr);
+ mutt_message_hook (Context, hdr, M_MESSAGEHOOK);
+
if ((msg = mx_open_message (Context, hdr->msgno)) == NULL)
return;
if (cur)
{
- mutt_message_hook (cur->hdr, M_MESSAGEHOOK);
+ /* mutt_message_hook (cur->hdr, M_MESSAGEHOOK); */
mutt_forward_intro (tmpfp, cur->hdr);
_mutt_copy_message (tmpfp, fp, cur->hdr, cur->hdr->content, cmflags, chflags);
mutt_forward_trailer (tmpfp);
{
if (idx[i]->content->tagged)
{
- mutt_message_hook (idx[i]->content->hdr, M_MESSAGEHOOK);
+ /* mutt_message_hook (idx[i]->content->hdr, M_MESSAGEHOOK); */
mutt_forward_intro (tmpfp, idx[i]->content->hdr);
_mutt_copy_message (tmpfp, fp, idx[i]->content->hdr,
idx[i]->content->hdr->content, cmflags, chflags);
int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV;
int chflags = CH_DECODE;
- mutt_message_hook (cur, M_MESSAGEHOOK);
+ /* mutt_message_hook (cur, M_MESSAGEHOOK); */
mutt_make_attribution (Context, cur, tmpfp);
{
int chflags = CH_DECODE, cmflags = 0;
- mutt_message_hook (cur, M_MESSAGEHOOK);
+ mutt_parse_mime_message (ctx, cur);
+ mutt_message_hook (ctx, cur, M_MESSAGEHOOK);
#ifdef HAVE_PGP
if ((cur->pgp & PGPENCRYPT) && option (OPTFORWDECODE))
}
if (option (OPTFORWQUOTE))
cmflags |= M_CM_PREFIX;
- mutt_parse_mime_message (ctx, cur);
+
mutt_copy_message (out, ctx, cur, cmflags, chflags);
mutt_forward_trailer (out);
return 0;
}
#endif /* HAVE_PGP */
- mutt_message_hook (cur, M_MESSAGEHOOK);
+ mutt_parse_mime_message (ctx, cur);
+ mutt_message_hook (ctx, cur, M_MESSAGEHOOK);
mutt_make_attribution (ctx, cur, out);
cmflags |= M_CM_WEED;
}
- mutt_parse_mime_message (ctx, cur);
mutt_copy_message (out, ctx, cur, cmflags, chflags);
-
+
mutt_make_post_indent (ctx, cur, out);
return 0;
/* change settings based upon recipients */
- mutt_message_hook (msg, M_SENDHOOK);
+ mutt_message_hook (NULL, msg, M_SENDHOOK);
if (killfrom)
{
+
+ /* include replies/forwarded messages, unless we are given a template */
+ if (!tempfile && (ctx || !(flags & (SENDREPLY|SENDFORWARD)))
+ && generate_body (tempfp, msg, flags, ctx, cur) == -1)
+ goto cleanup;
+
+ if (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0)
+ append_signature (tempfp);
+
+ /*
+ * this wants to be done _after_ generate_body, so message-hooks
+ * can take effect.
+ */
+
#ifdef HAVE_PGP
if (! (flags & SENDMAILX))
{
- /* include replies/forwarded messages, unless we are given a template */
- if (!tempfile && (ctx || !(flags & (SENDREPLY|SENDFORWARD)))
- && generate_body (tempfp, msg, flags, ctx, cur) == -1)
- goto cleanup;
-
- if (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0)
- append_signature (tempfp);
}
/* wait until now to set the real name portion of our return address so
that $realname can be set in a send-hook */