$Id$
+Wed Oct 26 13:22:02 EDT 2005 ajc
+* msgbase.c: Yet Another Fix to the handling of embedded message/rfc822
+
Tue Oct 25 17:29:12 EDT 2005 ajc
* msgbase.c: when a summary mode message list is requested, and the room
contains a pointer to a message which does not exist (this normally should
if (!strcasecmp(cbtype, "multipart/alternative")) {
++ma->is_ma;
ma->did_print = 0;
- return;
+ }
+ if (!strcasecmp(cbtype, "message/rfc822")) {
+ ++ma->freeze;
}
}
if (!strcasecmp(cbtype, "multipart/alternative")) {
--ma->is_ma;
ma->did_print = 0;
- return;
+ }
+ if (!strcasecmp(cbtype, "message/rfc822")) {
+ --ma->freeze;
}
}
* If we're in the middle of a multipart/alternative scope and
* we've already printed another section, skip this one.
*/
- if ( (ma->is_ma == 1) && (ma->did_print == 1) ) {
+ if ( (ma->is_ma) && (ma->did_print) ) {
lprintf(CTDL_DEBUG, "Skipping part %s (%s)\n",
partnum, cbtype);
return;
if (ma->is_ma > 0) {
for (i=0; i<num_tokens(CC->preferred_formats, '|'); ++i) {
extract_token(buf, CC->preferred_formats, i, '|', sizeof buf);
- if (!strcasecmp(buf, cbtype)) {
- if (num_tokens(partnum, '.') < 3) {
- safestrncpy(ma->chosen_part, partnum, sizeof ma->chosen_part);
- }
+ if ( (!strcasecmp(buf, cbtype)) && (!ma->freeze) ) {
+ safestrncpy(ma->chosen_part, partnum, sizeof ma->chosen_part);
}
}
}
struct ma_info {
int is_ma; /* Set to 1 if we are using this stuff */
+ int freeze; /* Freeze the replacement chain because we're
+ * digging through a subsection */
int did_print; /* One alternative has been displayed */
char chosen_part[128]; /* Which part of a m/a did we choose? */
};