]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
SUBST: complain about unknown tokens while parsing
[citadel.git] / webcit / subst.c
index f9d2ab9691d2e3fbe023a2428926ab4c820da259..09727d9f14ad8a671df0e7d95c801115e77bcdb3 100644 (file)
@@ -111,6 +111,9 @@ const char *CtxNames[]  = {
        "Context VCARD",
        "Context SIEVE List",
        "Context SIEVE Script",
+       "Context MailQ-Item",
+       "Context MailQ-Recipient",
+       "Context ServLogStatus",
        "Context UNKNOWN"
 };
 
@@ -581,10 +584,10 @@ long GetTemplateTokenNumber(StrBuf *Target, WCTemplputParams *TP, int N, long df
 }
 
 
-/**
- * \brief puts string into the template and computes which escape methon we should use
- * \param Source the string we should put into the template
- * \param FormatTypeIndex where should we look for escape types if?
+/*
+ * puts string into the template and computes which escape methon we should use
+ * Source = the string we should put into the template
+ * FormatTypeIndex = where should we look for escape types if?
  */
 void StrBufAppendTemplate(StrBuf *Target, 
                          WCTemplputParams *TP,
@@ -758,8 +761,10 @@ int GetNextParameter(StrBuf *Buf,
                else {
                        StrBufPeek(Buf, pch, -1, '\0');         
                        if (LoadTemplates > 1) {                        
-                               syslog(1, "DBG: got param [%s] %ld %ld\n", 
-                                       pchs, pche - pchs, strlen(pchs));
+                               syslog(1,
+                                       "DBG: got param [%s] %d %d\n", 
+                                       pchs, pche - pchs, strlen(pchs)
+                               );
                        }
                        Parm->Start = pchs;
                        Parm->len = pche - pchs;
@@ -1052,6 +1057,11 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
                                if (Handler->PreEvalFunc != NULL)
                                        Handler->PreEvalFunc(NewToken);
                        }
+               } else {
+                       LogTemplateError(
+                               NULL, "Token ", ERR_NAME, &TP,
+                               " isn't known to us.", 
+                               NULL);
                }
                break;
        case SV_GETTEXT: