summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1d11b74)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
int unlink_tempfile = 0;
int pagerfd = -1;
int unlink_tempfile = 0;
int pagerfd = -1;
- is_message = mutt_is_message_type (a->type, a->subtype);
+ is_message = mutt_is_message_type(a);
if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase (a->hdr->security))
return (rc);
if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase (a->hdr->security))
return (rc);
m->hdr &&
m->encoding != ENCBASE64 &&
m->encoding != ENCQUOTEDPRINTABLE &&
m->hdr &&
m->encoding != ENCBASE64 &&
m->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (m->type, m->subtype)) {
+ mutt_is_message_type(m)) {
/* message type attachments are written to mail folders. */
char buf[HUGE_STRING];
/* message type attachments are written to mail folders. */
char buf[HUGE_STRING];
if (!is_multipart(b) && b->parts)
body_list_wipe(&b->parts);
if (!is_multipart(b) && b->parts)
body_list_wipe(&b->parts);
- if (!mutt_is_message_type (b->type, b->subtype) && b->hdr) {
+ if (!mutt_is_message_type(b) && b->hdr) {
b->hdr->content = NULL;
header_delete(&b->hdr);
}
b->hdr->content = NULL;
header_delete(&b->hdr);
}
- if (fp && (is_multipart(b) || mutt_is_message_type(b->type, b->subtype)))
+ if (fp && (is_multipart(b) || mutt_is_message_type(b)))
mutt_parse_part (fp, b);
if (h) {
mutt_parse_part (fp, b);
if (h) {
plaintext = 1;
}
else if (b->type == TYPEMESSAGE) {
plaintext = 1;
}
else if (b->type == TYPEMESSAGE) {
- if (mutt_is_message_type (b->type, b->subtype))
+ if (mutt_is_message_type (b))
handler = message_handler;
else if (!ascii_strcasecmp ("delivery-status", b->subtype))
plaintext = 1;
handler = message_handler;
else if (!ascii_strcasecmp ("delivery-status", b->subtype))
plaintext = 1;
/* misc functions */
/****************************************************************************/
/* misc functions */
/****************************************************************************/
+int mutt_is_message_type(BODY *b)
+{
+ int tok;
+
+ if (b->type != TYPEMESSAGE)
+ return 0;
+
+ tok = mime_which_token(b->subtype, -1);
+ return tok == MIME_RFC822 || tok == MIME_NEWS;
+}
+
int mutt_is_text_part(BODY * b)
{
char *s = b->subtype;
int mutt_is_text_part(BODY * b)
{
char *s = b->subtype;
ENVELOPE *mutt_read_rfc822_header(FILE *, HEADER *, short, short);
int mutt_count_body_parts (HEADER *hdr, int flags);
ENVELOPE *mutt_read_rfc822_header(FILE *, HEADER *, short, short);
int mutt_count_body_parts (HEADER *hdr, int flags);
+int mutt_is_message_type(BODY *);
int mutt_is_multipart_encrypted(BODY *);
int mutt_is_multipart_signed(BODY *);
int mutt_is_application_pgp(BODY *);
int mutt_is_multipart_encrypted(BODY *);
int mutt_is_multipart_signed(BODY *);
int mutt_is_application_pgp(BODY *);
if (b->subtype) {
fseeko(fp, b->offset, SEEK_SET);
if (b->subtype) {
fseeko(fp, b->offset, SEEK_SET);
- if (mutt_is_message_type(b->type, b->subtype)) {
+ if (mutt_is_message_type(b)) {
b->parts = mutt_parse_messageRFC822(fp, b);
} else
if (mime_which_token(b->subtype, -1) == MIME_EXTERNAL_BODY) {
b->parts = mutt_parse_messageRFC822(fp, b);
} else
if (mime_which_token(b->subtype, -1) == MIME_EXTERNAL_BODY) {
/* We don't support multipart messages in the compose menu yet */
if (!compose && !m->collapsed
&& ((m->type == TYPEMULTIPART && !mutt_is_multipart_encrypted(m))
/* We don't support multipart messages in the compose menu yet */
if (!compose && !m->collapsed
&& ((m->type == TYPEMULTIPART && !mutt_is_multipart_encrypted(m))
- || mutt_is_message_type (m->type, m->subtype)))
+ || mutt_is_message_type(m)))
{
idx = mutt_gen_attach_list (m->parts, m->type, idx, idxlen, idxmax,
level + 1, compose);
{
idx = mutt_gen_attach_list (m->parts, m->type, idx, idxlen, idxmax,
level + 1, compose);
mutt_format_s (dest, destlen, prefix, aptr->content->description);
break;
}
mutt_format_s (dest, destlen, prefix, aptr->content->description);
break;
}
- if (mutt_is_message_type (aptr->content->type, aptr->content->subtype)
- && MsgFmt && aptr->content->hdr) {
+ if (mutt_is_message_type(aptr->content) && MsgFmt && aptr->content->hdr)
+ {
char s[SHORT_STRING];
_mutt_make_string (s, sizeof (s), MsgFmt, NULL, aptr->content->hdr,
char s[SHORT_STRING];
_mutt_make_string (s, sizeof (s), MsgFmt, NULL, aptr->content->hdr,
}
}
else if (aptr->content->description ||
}
}
else if (aptr->content->description ||
- (mutt_is_message_type
- (aptr->content->type, aptr->content->subtype)
+ (mutt_is_message_type(aptr->content)
&& MsgFmt && aptr->content->hdr))
break;
/* FALLS THROUGH TO 'f' */
&& MsgFmt && aptr->content->hdr))
break;
/* FALLS THROUGH TO 'f' */
return cur->tagged - ot;
}
return cur->tagged - ot;
}
-int mutt_is_message_type (int type, const char *subtype)
-{
- if (type != TYPEMESSAGE)
- return 0;
-
- subtype = NONULL (subtype);
- return (ascii_strcasecmp (subtype, "rfc822") == 0
- || ascii_strcasecmp (subtype, "news") == 0);
-}
-
static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
char **directory)
{
static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
char **directory)
{
else if (body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
else if (body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (body->type, body->subtype))
+ mutt_is_message_type(body))
mutt_default_save (buf, sizeof (buf), body->hdr);
else
buf[0] = 0;
mutt_default_save (buf, sizeof (buf), body->hdr);
else
buf[0] = 0;
body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (body->type, body->subtype));
+ mutt_is_message_type(body));
if (is_message) {
struct stat st;
if (is_message) {
struct stat st;
for (; b; b = b->next) {
i = init || b->collapsed;
if (i && option (OPTDIGESTCOLLAPSE) && b->type == TYPEMULTIPART
for (; b; b = b->next) {
i = init || b->collapsed;
if (i && option (OPTDIGESTCOLLAPSE) && b->type == TYPEMULTIPART
- && !ascii_strcasecmp (b->subtype, "digest"))
+ && mime_which_token(b->subtype, -1) == MIME_DIGEST)
attach_collapse (b->parts, 1, 1, 0);
attach_collapse (b->parts, 1, 1, 0);
- else if (b->type == TYPEMULTIPART
- || mutt_is_message_type (b->type, b->subtype))
+ else if (b->type == TYPEMULTIPART || mutt_is_message_type(b))
attach_collapse (b->parts, collapse, i, 0);
b->collapsed = collapse;
if (just_one)
attach_collapse (b->parts, collapse, i, 0);
b->collapsed = collapse;
if (just_one)
-static const char *Function_not_permitted =
-N_("Function not permitted in attach-message mode.");
-
-#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
- {\
- mutt_flushinp (); \
- mutt_error _(Function_not_permitted); \
- break; \
- }
-
-
-
-
void mutt_view_attachments (HEADER * hdr)
{
int secured = 0;
void mutt_view_attachments (HEADER * hdr)
{
int secured = 0;
attach_collapse (cur, 0, 1, 0);
mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
attach_collapse (cur, 0, 1, 0);
mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
+#define CHECK_ATTACH \
+ if (option(OPTATTACHMSG)) { \
+ mutt_flushinp (); \
+ mutt_error _("Function not permitted in attach-message mode."); \
+ break; \
+ }
+
for (;;) {
if (op == OP_NULL)
for (;;) {
if (op == OP_NULL)
- op = mutt_menuLoop (menu);
+ op = mutt_menuLoop(menu);
switch (op) {
case OP_ATTACH_VIEW_MAILCAP:
mutt_view_attachment (fp, idx[menu->current]->content, M_MAILCAP,
switch (op) {
case OP_ATTACH_VIEW_MAILCAP:
mutt_view_attachment (fp, idx[menu->current]->content, M_MAILCAP,
int mutt_tag_attach (MUTTMENU * menu, int n, int m);
int mutt_tag_attach (MUTTMENU * menu, int n, int m);
-int mutt_is_message_type (int, const char *);
-
void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
MUTTMENU * menu);
void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
MUTTMENU * menu);
static short check_msg (BODY * b, short err)
{
static short check_msg (BODY * b, short err)
{
- if (!mutt_is_message_type (b->type, b->subtype)) {
+ if (!mutt_is_message_type(b)) {
if (err)
mutt_error _("You may only bounce message/rfc822 parts.");
if (err)
mutt_error _("You may only bounce message/rfc822 parts.");
break;
while (--i >= 0) {
break;
while (--i >= 0) {
- if (mutt_is_message_type
- (idx[i]->content->type, idx[i]->content->subtype)) {
+ if (mutt_is_message_type(idx[i]->content)) {
nchildren = count_tagged_children (idx, idxlen, i);
if (nchildren == nattach)
return idx[i]->content->hdr;
nchildren = count_tagged_children (idx, idxlen, i);
if (nchildren == nattach)
return idx[i]->content->hdr;
if (cur) {
for (i = 0; i < idxlen; i++) {
if (cur) {
for (i = 0; i < idxlen; i++) {
- if (mutt_is_message_type
- (idx[i]->content->type, idx[i]->content->subtype)
+ if (mutt_is_message_type(idx[i]->content)
&& is_parent (i, idx, idxlen, cur))
parent = idx[i]->content->hdr;
if (idx[i]->content == cur)
&& is_parent (i, idx, idxlen, cur))
parent = idx[i]->content->hdr;
if (idx[i]->content == cur)
transform_to_7bit (a->parts, fpin);
}
transform_to_7bit (a->parts, fpin);
}
- else if (mutt_is_message_type (a->type, a->subtype)) {
+ else if (mutt_is_message_type(a)) {
mutt_message_to_7bit (a, fpin);
}
else {
mutt_message_to_7bit (a, fpin);
}
else {