- if (!ascii_strcasecmp ("plain", b->subtype) && type <= TXTPLAIN) {
- choice = b;
- type = TXTPLAIN;
- }
- else if (!ascii_strcasecmp ("enriched", b->subtype)
- && type <= TXTENRICHED) {
- choice = b;
- type = TXTENRICHED;
- }
- else if (!ascii_strcasecmp ("html", b->subtype) && type <= TXTHTML) {
- choice = b;
- type = TXTHTML;
+ switch (mime_which_token(b->subtype, -1)) {
+ case MIME_PLAIN:
+ if (type <= TXTPLAIN) {
+ choice = b;
+ type = TXTPLAIN;
+ }
+ break;
+ case MIME_ENRICHED:
+ if (type <= TXTENRICHED) {
+ choice = b;
+ type = TXTENRICHED;
+ }
+ break;
+ case MIME_HTML:
+ if (type <= TXTHTML) {
+ choice = b;
+ type = TXTHTML;
+ }
+ break;
+ default:
+ break;