]> code.citadel.org Git - citadel.git/commitdiff
Suppress display of a MIME multipart node if it is considered
authorArt Cancro <ajc@citadel.org>
Sun, 25 Mar 2007 21:31:38 +0000 (21:31 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 Mar 2007 21:31:38 +0000 (21:31 +0000)
to be the 'main' body which we are already viewing.

citadel/citadel_ipc.c
citadel/messages.c

index fe09c67d9fd254de06375e4f0e82affab8cf5c41..9b9500267c2a4326af5505072eccf83a9c51cbae 100644 (file)
@@ -577,10 +577,9 @@ int CtdlIPCGetSingleMessage(CtdlIPC *ipc, long msgnum, int headers, int as_mime,
                        /* If doing a MIME thing, pull out the extra headers */
                        if (as_mime == 4) {
                                do {
-                                       if (!strncasecmp(bbb, "Content-type: ", 14)) {
+                                       if (!strncasecmp(bbb, "Content-type:", 13)) {
                                                extract_token(mret[0]->content_type, bbb, 0, '\n', sizeof mret[0]->content_type);
-                                               strcpy(mret[0]->content_type,
-                                                       &mret[0]->content_type[14]);
+                                               strcpy(mret[0]->content_type, &mret[0]->content_type[13]);
                                                striplt(mret[0]->content_type);
 
                                                /* strip out ";charset=" portion.  FIXME do something with
@@ -592,6 +591,11 @@ int CtdlIPCGetSingleMessage(CtdlIPC *ipc, long msgnum, int headers, int as_mime,
                                                }
 
                                        }
+                                       if (!strncasecmp(bbb, "X-Citadel-MSG4-Partnum:", 23)) {
+                                               extract_token(mret[0]->mime_chosen, bbb, 0, '\n', sizeof mret[0]->mime_chosen);
+                                               strcpy(mret[0]->mime_chosen, &mret[0]->mime_chosen[23]);
+                                               striplt(mret[0]->mime_chosen);
+                                       }
                                        remove_token(bbb, 0, '\n');
                                } while ((bbb[0] != 0) && (bbb[0] != '\n'));
                                remove_token(bbb, 0, '\n');
index 07fd6be5fda25b186bdd85316859be0c43d2d458..cf54ca2ee745bcab157bf19c7ceb50f2299facae 100644 (file)
@@ -708,18 +708,21 @@ int read_message(CtdlIPC *ipc,
                           || (!strcasecmp(ptr->disposition, "inline"))
                           || (!strcasecmp(ptr->disposition, ""))
                        ) {
-                               color(DIM_WHITE);
-                               pprintf("Part ");
-                               color(BRIGHT_MAGENTA);
-                               pprintf("%s", ptr->number);
-                               color(DIM_WHITE);
-                               pprintf(": ");
-                               color(BRIGHT_CYAN);
-                               pprintf("%s", ptr->filename);
-                               color(DIM_WHITE);
-                               pprintf(" (%s, %ld bytes)\n", ptr->mimetype, ptr->length);
-                               if (!strncmp(ptr->mimetype, "image/", 6))
-                                       has_images++;
+                               if (strcasecmp(ptr->number, message->mime_chosen)) {
+                                       color(DIM_WHITE);
+                                       pprintf("Part ");
+                                       color(BRIGHT_MAGENTA);
+                                       pprintf("%s", ptr->number);
+                                       color(DIM_WHITE);
+                                       pprintf(": ");
+                                       color(BRIGHT_CYAN);
+                                       pprintf("%s", ptr->filename);
+                                       color(DIM_WHITE);
+                                       pprintf(" (%s, %ld bytes)\n", ptr->mimetype, ptr->length);
+                                       if (!strncmp(ptr->mimetype, "image/", 6)) {
+                                               has_images++;
+                                       }
+                               }
                        }
                }
        }