Update of /cvsroot/mahogany/M/src/classes
In directory usw-pr-cvs1:/tmp/cvs-serv14573/src/classes
Modified Files:
ComposeTemplate.cpp
Log Message:
expand the template for new messages/articles immediately if possible, only
postpone doing it if the template really uses the values of the message
headers
Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -b -u -2 -r1.22 -r1.23
--- ComposeTemplate.cpp 22 Feb 2002 20:28:30 -0000 1.22
+++ ComposeTemplate.cpp 4 Mar 2002 18:01:07 -0000 1.23
@@ -712,23 +712,12 @@
break;
+ // some shortcuts for the values of the "original:" category
case Var_To:
- // just the shorthand for "message:to"
- return ExpandMessage("to", value);
-
case Var_Subject:
- return ExpandMessage("subject", value);
-
case Var_Quote:
- return ExpandOriginal("quote", value);
-
case Var_Quote822:
- return ExpandOriginal("quote822", value);
-
case Var_Text:
- return ExpandOriginal("text", value);
-
case Var_Sender:
- ExpandOriginal("from", value);
- return TRUE;
+ return ExpandOriginal(name, value);
default:
@@ -884,4 +873,8 @@
switch ( header )
{
+ case MessageHeader_Subject:
+ *value = m_cv.GetSubject();
+ break;
+
case MessageHeader_FirstName:
case MessageHeader_LastName:
@@ -1342,4 +1335,13 @@
// public API
// ----------------------------------------------------------------------------
+
+extern bool TemplateNeedsHeaders(const String& templateValue)
+{
+ // check if there are any occurences of "${message:xxx}" in the template
+ //
+ // TODO: really parse it using a specialized expanded and without any
+ // sink, just checking if message category appears in it
+ return templateValue.Lower().Find("message:") != wxNOT_FOUND;
+}
extern bool ExpandTemplate(Composer& cv,
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates