* render submessages.
authorWilfried Göesgens <willi@citadel.org>
Tue, 11 Nov 2008 00:17:35 +0000 (00:17 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 11 Nov 2008 00:17:35 +0000 (00:17 +0000)
webcit/messages.c
webcit/msg_renderers.c
webcit/static/t/view_message.html
webcit/static/t/view_submessage.html [new file with mode: 0644]
webcit/webcit.h

index e82e0337985d070c5b6fe658468f079085ca295b..b67465d6841f4c824f31fb685582353a6d36b2a7 100644 (file)
@@ -228,7 +228,7 @@ int summcmp_rdate(const void *s1, const void *s2) {
  * printable_view      Nonzero to display a printable view
  * section             Optional for encapsulated message/rfc822 submessage
  */
-void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, char *section) {
+void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const char *section) {
        StrBuf *Buf;
        StrBuf *Token;
        StrBuf *FoundCharset;
index ca9b264fd45672d158ec91256e9161aa7e060494..ec3cf9632abdb1e3048f6ddffbdb227b72b5c15b 100644 (file)
@@ -267,6 +267,8 @@ void tmplput_MAIL_SUMM_DATE_NO(StrBuf *Target, int nArgs, WCTemplateToken *Token
 
 void render_MAIL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset)
 {
+       Mime->Data = NewStrBufPlain(NULL, Mime->length);
+       read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, ChrPtr(Mime->PartNum));
 /*
        if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) {
                for (i=0; i<num_tokens(mime_submessages, '|'); ++i) {
index 31102566340c284cea28666f6b246623d8bc2c88..09a789568bfee97a06f6d8c261140cd3deb5dc27 100644 (file)
@@ -1,37 +1,38 @@
 <div class="fix_scrollbar_bug message"
 onMouseOver=document.getElementById("msg<?MAIL:SUMM:N>").style.visibility="visible"
 onMouseOut=document.getElementById("msg<?MAIL:SUMM:N>").style.visibility="hidden" >
-<div class="message_header"><span><?MAIL:SUMM:DATESTR></span>
-<?_("from ")>
-<??("COND:MAIL:ANON",1)><a href="showuser?who=<?MAIL:SUMM:FROM("Q")>"><?MAIL:SUMM:FROM("X")></a><??("X", 1)>
-<?!("COND:MAIL:ANON",2)>***<??("X", 2)>
-<p style="visibility: hidden;" id="msg<?MAIL:SUMM:N>" class="msgbuttons">
 
-<a href="display_enter?recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a> 
+<div class="message_header">
+ <span><?MAIL:SUMM:DATESTR></span>
+ <?_("from ")>
+ <??("COND:MAIL:ANON",1)><a href="showuser?who=<?MAIL:SUMM:FROM("Q")>"><?MAIL:SUMM:FROM("X")></a><??("X", 1)>
+ <?!("COND:MAIL:ANON",2)>***<??("X", 2)>
+ <p style="visibility: hidden;" id="msg<?MAIL:SUMM:N>" class="msgbuttons">
 
-<a href="display_enter?replyquote=<?MAIL:SUMM:N>&recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("ReplyQuoted")><span>]</span></a> 
+   <a href="display_enter?recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a> 
 
-<a href="display_enter?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fwd:%%20", "Fwd:")>"><span>[</span><?_("Forward")><span>]</span></a> 
+   <a href="display_enter?replyquote=<?MAIL:SUMM:N>&recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("ReplyQuoted")><span>]</span></a> 
 
-<a href="confirm_move_msg?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a> 
+   <a href="display_enter?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fwd:%%20", "Fwd:")>"><span>[</span><?_("Forward")><span>]</span></a> 
 
-<a href="delete_msg?msgid=<?MAIL:SUMM:N>" onclick="return confirm('<?_("Delete this message?")>');"><span>[</span><?_("Delete")><span>]</span> </a> 
+   <a href="confirm_move_msg?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a> 
 
-<a href="#" onclick="window.open('msgheaders/<?MAIL:SUMM:N>', 'headers<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Headers")><span>]</span></a>
+   <a href="delete_msg?msgid=<?MAIL:SUMM:N>" onclick="return confirm('<?_("Delete this message?")>');"><span>[</span><?_("Delete")><span>]</span> </a> 
 
-<a href="#" onclick="window.open('printmsg/<?MAIL:SUMM:N>', 'print<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Print")><span>]</span></a>
-</p></div>
-
-<p class="message_subject"><?MAIL:SUMM:SUBJECT></p>
+   <a href="#" onclick="window.open('msgheaders/<?MAIL:SUMM:N>', 'headers<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Headers")><span>]</span></a>
 
+   <a href="#" onclick="window.open('printmsg/<?MAIL:SUMM:N>', 'print<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Print")><span>]</span></a>
+ </p>
+ <p class="message_subject"><?MAIL:SUMM:SUBJECT></p>
+</div>
 <div class="message_content"><div align="justify">
 <?MAIL:BODY>    
-</div>
-<?!("COND:MAIL:MIME:ATTACH:LINKS", 2)>
-<?ITERATE("MAIL:MIME:ATTACH:LINKS", "view_message_list_attach")>
-<?!("X", 2)>
-
 <?!("COND:MAIL:MIME:ATTACH:SUBMESSAGES", 3)>
 <?ITERATE("MAIL:MIME:ATTACH:SUBMESSAGES", "view_message_inline_attach")>
 <?!("X", 3)>
 
+<?!("COND:MAIL:MIME:ATTACH:LINKS", 2)>
+<?ITERATE("MAIL:MIME:ATTACH:LINKS", "view_message_list_attach")>
+<?!("X", 2)>
+
+</div>
diff --git a/webcit/static/t/view_submessage.html b/webcit/static/t/view_submessage.html
new file mode 100644 (file)
index 0000000..dc07d15
--- /dev/null
@@ -0,0 +1,15 @@
+<br><blockquote>
+<div class="message_header">
+  <span><?MAIL:SUMM:DATESTR></span>
+  <span><?_("from ")>
+    <??("COND:MAIL:ANON",1)><?MAIL:SUMM:FROM("X")><??("X", 1)>
+    <?!("COND:MAIL:ANON",2)>***<??("X", 2)>
+  </span>
+  <p class="message_subject"><?MAIL:SUMM:SUBJECT></p>
+</div>
+
+<div class="message_content">
+<?MAIL:BODY>    
+</div>
+
+</blockquote>
index 33fe47e2d588c29574916af9ff931ff2c328e692..8074087b12025cfb472a0ea36b20da92733b2911 100644 (file)
@@ -783,7 +783,7 @@ void dump_vars(void);
 void embed_main_menu(void);
 void serv_read(char *buf, int bytes);
 void readloop(char *oper);
-void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, char *section);
+void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const char *section);
 void do_addrbook_view(addrbookent *addrbook, int num_ab);
 void display_vcard(StrBuf *Target, const char *vcard_source, char alpha, int full, char *storename, long msgnum);
 void text_to_server(char *ptr);