From b56237dd73972014e8c694672400f1a91edc3193 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sat, 19 Jun 2010 15:07:35 +0000 Subject: [PATCH] * fix Re:/Fw mechnics for email replying/forwarding... Should that be case insensitive? --- webcit/msg_renderers.c | 21 +++++++++++++++++---- webcit/static/t/view_message.html | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index d3a7c423f..2d1e63f60 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -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; } diff --git a/webcit/static/t/view_message.html b/webcit/static/t/view_message.html index 7d7b5d9ea..b4de83fc4 100644 --- a/webcit/static/t/view_message.html +++ b/webcit/static/t/view_message.html @@ -27,12 +27,12 @@ onMouseOut=document.getElementById("msg").style.visibility="hidden %7C?replyquote=?recp=%22%22%3C%3E?subject=">[] %7C?replyquote=?recp=%22%22%3C%3E%2C?subject=">[] - %7C?fwdquote=&subject=">[] + %7C?fwdquote=&subject=">[] %7C?replyquote=?recp=&references=%3C%3E&subject=">[] %7C?replyquote=?recp=%2C&references=%3C%3E&subject=">[] - %7C?fwdquote=&subject=">[] + %7C?fwdquote=&subject=">[] -- 2.30.2