X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mx.c;h=a63b28f30e9fb3ed45236bd8537df99b8dcef6b3;hp=28ba348763a127363298429c2a16552f1ea67452;hb=e7ca08ff86e3d01578d024a62385bafe7bceffd2;hpb=b8c71f93b0296f815a6538182343ba67e88c0012 diff --git a/mx.c b/mx.c index 28ba348..a63b28f 100644 --- a/mx.c +++ b/mx.c @@ -48,7 +48,7 @@ #include "dotlock.h" #endif -#include "mutt_crypt.h" +#include #include "lib/list.h" #include "lib/debug.h" @@ -592,7 +592,7 @@ void mx_fastclose_mailbox (CONTEXT * ctx) hash_destroy (&ctx->id_hash, NULL); mutt_clear_threads (ctx); for (i = 0; i < ctx->msgcount; i++) - mutt_free_header (&ctx->hdrs[i]); + header_delete(&ctx->hdrs[i]); p_delete(&ctx->hdrs); p_delete(&ctx->v2r); @@ -947,7 +947,7 @@ void mx_update_tables (CONTEXT * ctx, int committing) if (ctx->id_hash && ctx->hdrs[i]->env->message_id) hash_delete (ctx->id_hash, ctx->hdrs[i]->env->message_id, ctx->hdrs[i], NULL); - mutt_free_header (&ctx->hdrs[i]); + header_delete(&ctx->hdrs[i]); } } #undef this_body @@ -1423,3 +1423,27 @@ int mx_rebuild_cache (void) { return (0); #endif } + +void mutt_parse_mime_message (CONTEXT * ctx, HEADER * cur) +{ + MESSAGE *msg; + int flags = 0; + + do { + if (cur->content->type != TYPEMESSAGE + && cur->content->type != TYPEMULTIPART) + break; /* nothing to do */ + + if (cur->content->parts) + break; /* The message was parsed earlier. */ + + if ((msg = mx_open_message (ctx, cur->msgno))) { + mutt_parse_part (msg->fp, cur->content); + + cur->security = crypt_query (cur->content); + + mx_close_message (&msg); + } + } while (0); + mutt_count_body_parts (cur, flags | M_PARTS_RECOUNT); +}