* catch more render bugs
authorWilfried Göesgens <willi@citadel.org>
Thu, 20 Nov 2008 00:16:01 +0000 (00:16 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 20 Nov 2008 00:16:01 +0000 (00:16 +0000)
* implement local recipient display with hostname if we don't hae a RFCA header.

webcit/html2html.c
webcit/messages.c
webcit/msg_renderers.c
webcit/static/t/view_message.html
webcit/subst.c

index e77c2a13ed7c3dbc62a3e46cf5b64f1fba1b3a95..f24ca184dc554a2a54c059775eb1ff4fd85cfea3 100644 (file)
@@ -502,7 +502,7 @@ void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf)
        for (pos = ChrPtr(Source); (pos < end) && (start == NULL); ++pos) {
                if (!strncasecmp(pos, "http://", 7))
                        start = pos;
-               if (!strncasecmp(pos, "ftp://", 6))
+               else if (!strncasecmp(pos, "ftp://", 6))
                        start = pos;
        }
 
index f263d5c1b45160fb2f1a3930a9f5ee1d75367833..ffbfab310826fa6d01c555fc9e1372c6f3a98a50 100644 (file)
@@ -246,7 +246,7 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, in
        const char *Key;
 
        Buf = NewStrBuf();
-       lprintf(1, "-------------------MSG4 %ld|%s--------------\n", msgnum, ChrPtr(PartNum));
+       lprintf(1, "----------%s---------MSG4 %ld|%s--------------\n", tmpl, msgnum, ChrPtr(PartNum));
        serv_printf("MSG4 %ld|%s", msgnum, ChrPtr(PartNum));
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) != 1) {
index 6b81166f9f12937bf96cf937a10414a13f8b8241..f294c5e3537ab894babe9b943775687e508eb587 100644 (file)
@@ -192,7 +192,11 @@ void tmplput_MAIL_SUMM_RFCA(StrBuf *Target, int nArgs, WCTemplateToken *Token, v
        message_summary *Msg = (message_summary*) Context;
        StrBufAppendBuf(Target, Msg->Rfca, 0);
 }
-
+int Conditional_MAIL_SUMM_RFCA(WCTemplateToken *Tokens, void *Context, int ContextType)
+{
+       message_summary *Msg = (message_summary*) Context;
+       return StrLength(Msg->Rfca) > 0;
+}
 
 void examine_node(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
 {
@@ -812,6 +816,7 @@ InitModule_MSGRENDERERS
        RegisterNamespace("ATT:TYPE", 0, 1, tmplput_ATT_Contenttype, CTX_ATT);
        RegisterNamespace("ATT:FILENAME", 0, 1, tmplput_ATT_FileName, CTX_ATT);
 
+       RegisterConditional(HKEY("MAIL:SUMM:RFCA"), 0, Conditional_MAIL_SUMM_RFCA,  CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:OTHERNODE"), 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
index b3bf0a53450c20fa512d94ccecf6ea0db973414c..0588167923062b508560ede546ae2fc7403f86d1 100644 (file)
@@ -5,8 +5,11 @@ 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")>"&lt;<?MAIL:SUMM:RFCA>&gt;</a><??("X", 1)>
- <?!("COND:MAIL:ANON",2)>***<??("X", 2)>
+ <??("COND:MAIL:ANON",1)><a href="showuser?who=<?MAIL:SUMM:FROM("Q")>">"<?MAIL:SUMM:FROM("X")>"
+<?!("MAIL:SUMM:RFCA", 2)>&lt;<?MAIL:SUMM:RFCA>&gt;</a><?!("X", 2)>
+<??("MAIL:SUMM:RFCA", 3)></a> @ <?SERV:NODENAME><??("X", 3)>
+<??("X", 1)>
+ <?!("COND:MAIL:ANON", 4)>***<??("X", 4)>
  <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")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re:%%20", "Re:")>"><span>[</span><?_("Reply")><span>]</span></a> 
@@ -27,12 +30,12 @@ onMouseOut=document.getElementById("msg<?MAIL:SUMM:N>").style.visibility="hidden
 </div>
 <div class="message_content"><div align="justify">
 <?MAIL:BODY>
-<?!("COND:MAIL:MIME:ATTACH:SUBMESSAGES", 3)>
+<?!("COND:MAIL:MIME:ATTACH:SUBMESSAGES", 5)>
 <?ITERATE("MAIL:MIME:ATTACH:SUBMESSAGES", "view_message_inline_attach")>
-<?!("X", 3)>
-<?!("COND:MAIL:MIME:ATTACH:LINKS", 2)>
+<?!("X", 5)>
+<?!("COND:MAIL:MIME:ATTACH:LINKS", 6)>
 <?ITERATE("MAIL:MIME:ATTACH:LINKS", "view_message_list_attach")>
-<?!("X", 2)>
+<?!("X", 6)>
 
 </div>
 </div>
index 8fd62ef1a56a92020bf995488c8a1792a8a7efa6..3449489ab78e2e22c11db36ce6f662ed2163fe28 100644 (file)
@@ -827,18 +827,19 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
        case SV_GETTEXT:
                if (NewToken->nParameters !=1) {
                        lprintf(1, "Gettext (in '%s' line %ld); "
-                               "requires exactly 1 parameter, yau gave %ld params [%s]\n", 
+                               "requires exactly 1 parameter, you gave %ld params [%s]\n", 
                                ChrPtr(pTmpl->FileName),
                                NewToken->Line,
                                NewToken->nParameters, 
                                ChrPtr(NewToken->FlatToken));
+                       NewToken->Flags = 0;
                        break;
                }
                break;
        case SV_SUBTEMPL:
                if (NewToken->nParameters != 1) {
                        lprintf(1, "Subtemplates (in '%s' line %ld); "
-                               "require exactly 1 parameter, yau gave %ld params [%s]\n", 
+                               "require exactly 1 parameter, you gave %ld params [%s]\n", 
                                ChrPtr(pTmpl->FileName),
                                NewToken->Line,
                                NewToken->nParameters, 
@@ -851,11 +852,12 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
        case SV_NEG_CONDITIONAL:
                if (NewToken->nParameters <2) {
                        lprintf(1, "Conditional (in '%s' line %ld); "
-                               "require at least 2 parameters, yau gave %ld params [%s]\n", 
+                               "require at least 2 parameters, you gave %ld params [%s]\n", 
                                ChrPtr(pTmpl->FileName),
                                NewToken->Line,
                                NewToken->nParameters, 
                                ChrPtr(NewToken->FlatToken));
+                       NewToken->Flags = 0;
                        break;
                }
                if (!GetHash(Conditionals,