generalize the idea of tokens a bit more, don't restrict it to the rfc822
[apps/madmutt.git] / lib-mime / mime.h
index b235acc..8c0d3b8 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdio.h>
 
 #include "mime-types.h"
+#include "mime-token.h"
 
 extern const char MimeSpecials[];
 extern const char *BodyTypes[];
@@ -43,8 +44,9 @@ extern const char *BodyEncodings[];
 
 #define is_multipart(x) \
     ((x)->type == TYPEMULTIPART \
-     || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
-                                      || !strcasecmp((x)->subtype, "news"))))
+     || ((x)->type == TYPEMESSAGE && \
+         (!mime_which_token((x)->subtype, -1) == MIME_RFC822) \
+         || !mime_which_token((x)->subtype, -1) == MIME_NEWS))
 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
 #define ENCODING(X) BodyEncodings[(X)]