X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Fcrypt.c;h=c17793c5c2788ee3a8c7e4b7901556f82216af36;hp=919c3bbd08b6388b0e7d48ab9dc87f8402a579bc;hb=refs%2Fheads%2Ftry-some-d;hpb=230399f9632c37b66c1c117a17e8327eae6b3235 diff --git a/lib-mime/crypt.c b/lib-mime/crypt.c index 919c3bb..c17793c 100644 --- a/lib-mime/crypt.c +++ b/lib-mime/crypt.c @@ -32,9 +32,8 @@ #include -#include - #include "mime.h" +#include "crypt.h" int mutt_is_multipart_signed(BODY * b) { @@ -85,11 +84,10 @@ int mutt_is_application_pgp (BODY * m) int subtype = mime_which_token(m->subtype, -1); if (m->type == TYPEAPPLICATION) { - if (subtype != MIME_PGP || subtype != MIME_X_PGP_MESSAGE) { + if (subtype == MIME_PGP || subtype == MIME_X_PGP_MESSAGE) { int tok; tok = mime_which_token(parameter_getval(m->parameter, "x-action"), -1); - if (tok == MIME_SIGN || tok == MIME_SIGNCLEAR) t |= PGPSIGN; @@ -111,17 +109,14 @@ int mutt_is_application_pgp (BODY * m) if (m->type == TYPETEXT && subtype == MIME_PLAIN) { const char *p; - if ((p = parameter_getval(m->parameter, "x-mutt-action")) - || (p = parameter_getval(m->parameter, "x-action")) - || (p = parameter_getval(m->parameter, "action"))) - { + if ((p = parameter_getval(m->parameter, "x-action"))) { int tok = mime_which_token(p, -1); switch (tok) { - case MIME_PGP_SIGN: + case MIME_PGP_SIGNED: t |= PGPSIGN; break; - case MIME_PGP_ENCRYPT: + case MIME_PGP_ENCRYPTED: t |= PGPENCRYPT; break; @@ -138,6 +133,8 @@ int mutt_is_application_pgp (BODY * m) return t ? t | PGPINLINE : 0; } +#include "mutt.h" + int mutt_is_application_smime (BODY * m) { char *t = NULL; @@ -195,10 +192,10 @@ int mutt_is_application_smime (BODY * m) case 'm': case 'M': /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ - return (SMIMESIGN | SMIMEOPAQUE); + return SMIMESIGN | SMIMEOPAQUE; case 's': case 'S': - return (SMIMESIGN | SMIMEOPAQUE); + return SMIMESIGN | SMIMEOPAQUE; } } }