* fix Re:/Fw mechnics for email replying/forwarding... Should that be case insensitive?
authorWilfried Göesgens <willi@citadel.org>
Sat, 19 Jun 2010 15:07:35 +0000 (15:07 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 19 Jun 2010 15:07:35 +0000 (15:07 +0000)
webcit/msg_renderers.c
webcit/static/t/view_message.html

index d3a7c423f2b86bef184cee2fb329365607b8ce79..2d1e63f609d01cd7b4615495155c3fe68b7631e9 100644 (file)
@@ -261,8 +261,6 @@ void tmplput_MAIL_SUMM_FROM(StrBuf *Target, WCTemplputParams *TP)
        StrBufAppendTemplate(Target, TP, Msg->from, 0);
 }
 
-
-
 void examine_subj(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
 {
        FreeStrBuf(&Msg->subj);
@@ -270,14 +268,29 @@ void examine_subj(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
        StrBuf_RFC822_to_Utf8(Msg->subj, HdrLine, WC->DefaultCharset, FoundCharset);
 }
 void tmplput_MAIL_SUMM_SUBJECT(StrBuf *Target, WCTemplputParams *TP)
-{/*////TODO: Fwd: and RE: filter!!*/
-
+{
        message_summary *Msg = (message_summary*) CTX;
+
+       if (TP->Tokens->nParameters == 4)
+       {
+               const char *pch;
+               long len;
+               
+               GetTemplateTokenString(Target, TP, 3, &pch, &len);
+               if ((len > 0)&&
+                   (strstr(ChrPtr(Msg->subj), pch) == NULL))
+               {
+                       GetTemplateTokenString(Target, TP, 2, &pch, &len);
+                       StrBufAppendBufPlain(Target, pch, len, 0);
+               }
+       }
        StrBufAppendTemplate(Target, TP, Msg->subj, 0);
 }
 int Conditional_MAIL_SUMM_SUBJECT(StrBuf *Target, WCTemplputParams *TP)
 {
        message_summary *Msg = (message_summary*) CTX;
+
+
        return StrLength(Msg->subj) > 0;
 }
 
index 7d7b5d9eac3afff1158913bddc0073a33030cded..b4de83fc4aa4f4dd4830f71ffe77b8ac4d709b35 100644 (file)
@@ -27,12 +27,12 @@ onMouseOut=document.getElementById("msg<?MAIL:SUMM:N>").style.visibility="hidden
        <?!("COND:MAIL:SUMM:RFCA", 10)>
                <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E?subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a> 
                <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E%2C<?MAIL:SUMM:ALLRCPT("U")>?subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("ReplyAll")><span>]</span></a> 
-               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fwd:%%20", "Fwd:")>"><span>[</span><?_("Forward")><span>]</span></a> 
+               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fw:%%20", "Fw:")>"><span>[</span><?_("Forward")><span>]</span></a> 
        <?!("X", 10)>
        <??("COND:MAIL:SUMM:RFCA", 11)>
                <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a> 
                <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=<?MAIL:SUMM:FROM("U")>%2C<?MAIL:SUMM:ALLRCPT("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%20", "Re:")>"><span>[</span><?_("ReplyAll")><span>]</span></a> 
-               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fwd:%%20", "Fwd:")>"><span>[</span><?_("Forward")><span>]</span></a> 
+               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fw:%%20", "Fw:")>"><span>[</span><?_("Forward")><span>]</span></a> 
        <??("X", 11)>
 <??("X", 9)>
 <?!("COND:ROOM:EDITACCESS", 14)>