]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* "Headers" option in view message
[citadel.git] / webcit / messages.c
index c075d10c473f8269d60fca569c00bd69126ac54e..e639c71e3a7dbb07806143f98b139a02523db711 100644 (file)
@@ -812,6 +812,12 @@ void read_message(long msgnum, int printable_view, char *section) {
                        );
                }
 
+               /* Headers */
+               wprintf("<a href=\"#\" onClick=\"window.open('msgheaders/%ld', 'headers%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
+                       "[%s]</a>", msgnum, msgnum, _("Headers"));
+
+
+               /* Print */
                wprintf("<a href=\"#\" onClick=\"window.open('printmsg/%ld', 'print%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
                        "[%s]</a>", msgnum, msgnum, _("Print"));
 
@@ -1036,6 +1042,35 @@ void print_message(char *msgnum_as_string) {
 
 
 
+/*
+ * Display a message's headers
+ */
+void display_headers(char *msgnum_as_string) {
+       long msgnum = 0L;
+       char buf[1024];
+
+       msgnum = atol(msgnum_as_string);
+       output_headers(0, 0, 0, 0, 0, 0);
+
+       wprintf("Content-type: text/plain\r\n"
+               "Server: %s\r\n"
+               "Connection: close\r\n",
+               SERVER);
+       begin_burst();
+
+       serv_printf("MSG2 %ld|3", msgnum);
+       serv_getln(buf, sizeof buf);
+       if (buf[0] == '1') {
+               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                       wprintf("%s\n", buf);
+               }
+       }
+
+       wDumpContent(0);
+}
+
+
+
 /*
  * Read message in simple, JavaScript-embeddable form for 'forward'
  * or 'reply quoted' operations.