X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Frfc1524.c;h=456e04cdd1b503b7bf8042ac4aa867c364a43f81;hp=4fe4f2b355222dd09ffaeb2c6435b108fa24752a;hb=a0aa4a45870f1607e8b41760866071692675c84d;hpb=2a2f2f9a5bad73c883b7f9c9b4166d932b6aaf37 diff --git a/lib-mime/rfc1524.c b/lib-mime/rfc1524.c index 4fe4f2b..456e04c 100644 --- a/lib-mime/rfc1524.c +++ b/lib-mime/rfc1524.c @@ -35,24 +35,7 @@ * rfc1524. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include @@ -60,6 +43,43 @@ #include "mime.h" #include "attach.h" +void rfc1524_entry_wipe(rfc1524_entry *p) +{ + p_delete(&p->command); + p_delete(&p->testcommand); + p_delete(&p->composecommand); + p_delete(&p->composetypecommand); + p_delete(&p->editcommand); + p_delete(&p->printcommand); + p_delete(&p->nametemplate); + p_delete(&p->convert); +} + +/* returns 1 if Mutt can't display this type of data, 0 otherwise */ +int rfc1524_mailcap_isneeded(BODY * m) +{ + int tok; + + switch (m->type) { + case TYPEMULTIPART: + case TYPEMESSAGE: + return 0; + + case TYPEAPPLICATION: + return !(mutt_is_application_pgp(m) || mutt_is_application_smime(m)); + + case TYPETEXT: + tok = mime_which_token(m->subtype, -1); + if (tok == MIME_PLAIN + || tok == MIME_RFC822_HEADERS + || tok == MIME_ENRICHED) + return 0; + break; + } + + return 1; +} + /* The command semantics include the following: * %s is the filename that contains the mail body data * %t is the content type, like text/plain