]> code.citadel.org Git - citadel.git/commitdiff
* Comments & cosmetics for previous update
authorArt Cancro <ajc@citadel.org>
Wed, 10 Oct 2001 18:35:12 +0000 (18:35 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 10 Oct 2001 18:35:12 +0000 (18:35 +0000)
citadel/ChangeLog
citadel/msgbase.c

index 92a17bbc8e91377440f5b3984b55f66d70fb749e..acdf36b0474fe0bef913cf8f92bd7ce40ed70ecf 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.55  2001/10/10 18:35:12  ajc
+ * Comments & cosmetics for previous update
+
  Revision 580.54  2001/10/10 17:12:54  ajc
  * Bugfix for MSG0 command to properly handle multipart/alternative
 
@@ -2785,4 +2788,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index f1b8c0530bffe54c5fb3f46f346f715b9faa5c66..981fc25838ba94221b4362430fb56ce75877800e 100644 (file)
@@ -821,7 +821,14 @@ void CtdlFreeMessage(struct CtdlMessage *msg)
 
 
 /*
- * Pre callback function for mime parser that wants to display text
+ * Pre callback function for multipart/alternative
+ *
+ * NOTE: this differs from the standard behavior for a reason.  Normally when
+ *       displaying multipart/alternative you want to show the _last_ usable
+ *       format in the message.  Here we show the _first_ one, because it's
+ *       usually text/plain.  Since this set of functions is designed for text
+ *       output to non-MIME-aware clients, this is the desired behavior.
+ *
  */
 void fixed_output_pre(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, size_t length, char *encoding,
@@ -831,13 +838,12 @@ void fixed_output_pre(char *name, char *filename, char *partnum, char *disp,
                if (!strcasecmp(cbtype, "multipart/alternative")) {
                        ma->is_ma = 1;
                        ma->did_print = 0;
-                       lprintf(9, "multipart/alternative: <%s>\n", ma->prefix);
                        return;
                }
 }
 
 /*
- * Pre callback function for mime parser that wants to display text
+ * Post callback function for multipart/alternative
  */
 void fixed_output_post(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, size_t length, char *encoding,
@@ -847,7 +853,6 @@ void fixed_output_post(char *name, char *filename, char *partnum, char *disp,
                if (!strcasecmp(cbtype, "multipart/alternative")) {
                        ma->is_ma = 0;
                        ma->did_print = 0;
-                       lprintf(9, "multipart/alternative: <%s>\n", ma->prefix);
                        return;
                }
 }
@@ -865,12 +870,15 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
                CIT_UBYTE ch = 0;
 
                lprintf(9, "fixed_output() type=<%s>\n", cbtype);       
-       
+
+               /*
+                * 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) ) {
                        lprintf(9, "Skipping part %s (%s)\n", partnum, cbtype);
                        return;
                }
-       
                ma->did_print = 1;
        
                if ( (!strcasecmp(cbtype, "text/plain"))